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
GestureHandlerRootView
in Modal does not register touch events when the modal is used inside a Stack Navigator (Android Only)
#9757
Comments
Couldn't find version numbers for the following packages in the issue:
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3. |
So it works fine if we use a stack modal as described in https://reactnavigation.org/docs/modal/ : https://snack.expo.dev/@thomascoldwell/react-navigation---rngh-root-view-bug-android---stack-modal Can be worked around at least with this, but ideally would love to be able to launch it just from the built in RN modal. Will do some more digging and see if I can find a way for it work like that 😀 |
Appears to be linked to this issue on RNGH and there seems to be a PR pending that likely resolves this: |
Okay turns out using https://snack.expo.dev/@thomascoldwell/react-navigation---rngh-root-view-bug-android---portal-fix |
As a side note: I used react-native-portal instead of |
It happens because Stack Navigator already uses Probably there needs to be prop to wrap it regardless, or maybe it should wrap regardless of parent. Please open an issue in gesture handler repo so that they can decide what to do here. |
Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro. |
Current behavior
Currently, I have a modal that uses a
PanGestureHandler
within for my libraryexpo-image-editor
that let's users move a frame around to crop images. I have followed the guide to set this up from the RNGH docs https://docs.swmansion.com/react-native-gesture-handler/docs/#for-library-authors - wrapping the content of the modal in a<GestureHandlerRootView>
, however, this does not register any touch events to thePanGestureHandler
on Android (on iOS it's stated that this will just be evaluated as a<View>
as per the docs).I had a hunch it might have something to do with projects using my library using
react-navigation
as I know RNGH is a dep of it. I set up some test snacks to see if this was the case and it looks like the only difference is that it produces this behavior when wrapped in a Stack Navigator and works as expected without the Stack Navigator. See the below demos that showcase this behavior:Also the behavior is identical both in the managed and bare Expo workflow's following the installation steps for each as per the docs.
Expected behavior
The use of a
<GestureHandlerRootView>
inside a modal should pass gesture events to it's child RNGH components when using a Stack Navigator.Reproduction
https://snack.expo.dev/@thomascoldwell/react-navigation---rngh-root-view-bug-android
Platform
Packages
Environment
The text was updated successfully, but these errors were encountered: