Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hsjoberg
Copy link

@hsjoberg hsjoberg commented Aug 4, 2023

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",

@github-actions
Copy link

github-actions bot commented Aug 4, 2023

Hey @hsjoberg! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines.

@netlify
Copy link

netlify bot commented Aug 4, 2023

Deploy Preview for react-navigation-example ready!

Name Link
🔨 Latest commit 6dc17b0
🔍 Latest deploy log https://app.netlify.com/sites/react-navigation-example/deploys/64cd346b0438ef00085ba48f
😎 Deploy Preview https://deploy-preview-11522--react-navigation-example.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (c43208f) 75.49% compared to head (6dc17b0) 75.49%.

❗ 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.
📢 Have feedback on the report? Share it here.

Copy link
Member

@osdnk osdnk left a 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?

Copy link
Member

@satya164 satya164 left a 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants