New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Drawer on macos is registering clicks despite being inactive #11522
base: main
Are you sure you want to change the base?
Conversation
Hey @hsjoberg! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines. |
✅ Deploy Preview for react-navigation-example ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportPatch and project coverage have no change.
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #11522 +/- ##
=======================================
Coverage 75.49% 75.49%
=======================================
Files 190 190
Lines 5742 5742
Branches 2261 2261
=======================================
Hits 4335 4335
Misses 1360 1360
Partials 47 47 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I suggest we wait for the fix in Reanimated. Can you please attach some video?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Please link to the related bug report in react-native-macos repo to make sure we can track it.
Also the pointerEvents
should be set based on similar logic as detecting when overlay can be tapped
const active = progress.value > PROGRESS_EPSILON; |
Can you update the logic to match it?
Hey.
Motivation
If you use the drawer on react-native-macos, it will register click events even if the drawer is inactive, resulting in everything underneath the drawer being unclickable.
I suspect it's because of some
zIndex
layering issues (we set zIndex to -1 when inactive) going on, but not sure.This PR addresses this issue by setting
pointerEvents
to"none"
for react-native-macos.Test plan
Try @react-navigation/drawer@7.0.0-alpha.2 on react-native-macos old arch (could be the same on new arch, I don't know). Anything under where the drawer would be cannot be clicked on.
Note: react-reanimated broke its react-native-macos support >= 2.0, I have a pending fix for that here:
software-mansion/react-native-reanimated#4669
So either use react-reanimated 1 or use my fork:
"react-native-reanimated": "git+https://github.com/hsjoberg/react-native-reanimated.git#e998c740a083f075e6845a9ed1c81d5df1c220fc",