-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Drawer Navigator: Can't highlight text due to PanGestureHandler applying user-select: none #10922
Comments
Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link, a www.typescriptlang.org/play link or link to a GitHub repo under your username). Can you provide a minimal repro which demonstrates the issue? Please try to keep the repro as small as possible and make sure that we can run it without additional setup. A repro will help us debug the issue. The issue will be closed automatically after a while if you don't provide a repro. |
Hi @TyPhyter 👋 Have you tried invoking I sure hope the new web implementation should work without action on react-navigation side. Cheers |
Thanks for the reply @kacperkapusciak ! We did try that and it did not seem to resolve the issue. I think our only way forward at this point without a resolution in this package will be to drop back to reanimated version 1 and use the legacy implementation of drawer navigator (crossing fingers that works). I can set up a repro repo this afternoon for reference. |
A reproduction has been provided. Verified that |
Hi @TyPhyter 👋 Calling We are planning to add new prop to gesture handlers on web, which will allow users to manually enable/disable |
## Description This PR adds `userSelect` prop to web versions of gesture handlers in response to [this issue in react-navigation](react-navigation/react-navigation#10922). It also reverts changes made in PR mentioned in [this issue](#2211). Now gesture handlers have `userSelect` property, which can be used to manually set `userSelect` css property. This change also affects `DrawerLayout` and `ScrollView`. Not that by default `userSelect` is set to `"none"`. To enable it, just pass this prop to handler with proper value. Possible values are: `"none" | "auto" | "text"`. For example: ```JSX <PanGestureHandler userSelect="auto"> // ... </PanGestureHandler> ``` ## Test plan Tested on example app. Co-authored-by: Michał Bert <michal.bert@swmansion.com>
now that this has been implemented in |
i think i'm also seeing this behavior, any movement? |
You can now override
|
hmm, neither of those approaches is working for me :( |
You need to do both. The first call should be made in your entry file ( |
aha! thanks! |
Hello Since i migrate my project to expo 50 from expo 48 I can't select text in web for page that is in my drawer. This is my code
|
Hi @coolben54! As far as I can see I believe you have to pass screenOptions={{
gestureHandlerProps: {
...Platform.select({ web: { userSelect: "text" } }),
},
}} It worked in my case. It can be quite misleading though, since react-navigation docs say that this option is not supported on web (cc @adamhari). |
Thank you ! |
Current behavior
Using the modern implementation of the Drawer Navigator in web builds, you cannot select text on any of your screens rendered by the navigator due to a user-select: none; rule being applied.
software-mansion/react-native-gesture-handler#2211
This issue from react-native-gesture-handler references the issue at hand in this package, which seems to propagate to this package due to the use of PanGestureHandler in the modern Drawer implementation.
react-navigation-gesture-handler released v2.7.1 today which addresses this issue, if we could get a react-navigation/drawer release that references this new version that would be great.
NOTE: I tried to get a repro going on snack but it doesn't seem possible to do with reanimated >2.5? Putting this up for now, if it gets closed I'll try to make a personal repo with a repro tomorrow.
Expected behavior
Should be able to select text rendered by drawer navigator.
Reproduction
Repro repo here
Repro has an attempt at using
enableExperimentalWebImplementation()
from react-native-gesture-handler commented out. Unsure if it should be above, below, or inplace of theimport 'react-native-gesture-handler';
, but we tried all three to no avail.Platform
Packages
Environment
The text was updated successfully, but these errors were encountered: