Doesn't work in a modal
Hi !
I have a little issue on Android, onGestureEvent is not trigger when GestureHandler components is on a modal on Android. When I change the modal to a View, it works perfectly 👌
No problem on iOS
+1 any workaround?
I don’t use Modal for now, I just re-create it with a View in absolute position
using modal screen for now, after googling and chats Modal from RN considered too much buggy thing
+1
Hi, @martinezguillaume, @mordaha, @csto I did take a look on this issue and I suppose it's not a matter of our library, but RN Core.
@osdnk is this fixable?
+1 gesture does not work on modal
I also ran into this bug today.
Same problem. Gesture does not work on modal on Android. Expo for example
Same for me. Tested react-native's PanResponder handlers on modal - works fine.
I have a thoughts about this: when we are linking this library to android project, we are doing next step
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
And we know that modal is separate package. May be theres sense to do something same with it?
I was using a standard React Native Modal and was experiencing this issue.
I worked around the problem by creating a new screen and displaying it as a modal. I'm using react-native-navigation, so:
Navigation.showModal({
component: {
name: navRoutes.ImageModal,
passProps: { image },
},
})
Gestures are working as expected on both iOS and Android, and I still get transparent background that I wanted from my original modal.
I have dug into it for a while.
- It's a problem of RNGH. Sorry 😒
- It happens bc modals are not rendered below an RN root view.
- It's fixable by replacing modals' mechanism in a similar way as we do with an RNRootView by wrapping it with some extra logic. See https://github.com/kmagiera/react-native-gesture-handler/blob/master/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.java
- I have no time to do it now, it's time-consuming work and probably requires copying some code in an RNGH core on Android native side.
If someone wants and has time to do it, I'll happily review it and merge immediately if it would be workable and not too hacky.
@martinezguillaume @mordaha @csto @mars-lan @ParhamZare @ewendel @Via-profit @Dmitrylolo @LaVielle
Also, I've made a try two months ago.
https://github.com/kmagiera/react-native-gesture-handler/commit/139da18039683bed3c439c991c7eaf802086bf86
Maybe it could be an inspiration for someone 🤷♂️
Hey @osdnk I need this feature for my app, so I was thinking I could give it a try, but I don't have a lot of experience with RNGestureHandler, or with Android. Could you give me some more insight on what I would need to do to make it work ? Also I was looking at your previous try, and I would like to know what's missing for it to be finished, and if it could be used as a starting point.
same error.
@kmagiera @osdnk any update on this?
even Touchable*'s don't work inside the modal and this is frustrating
+1. i use reanimated-bottom-sheet with modal
Any updates? Or perhaps, any other modal component that does not suffer from this issue? RN's modal honestly works like quite bad and is full of bugs (such as getting stuck if combined with an alert)
@cristianoccazinsp I ended up using https://github.com/react-native-community/react-native-modal
Odd. That component is supposed to use react's modal internally. Did it make a difference to you?
El jue., 30 de mayo de 2019 14:38, Mars Lan [email protected] escribió:
@cristianoccazinsp https://github.com/cristianoccazinsp I ended up using https://github.com/react-native-community/react-native-modal
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kmagiera/react-native-gesture-handler/issues/139?email_source=notifications&email_token=ALU263ACF3LNSRSPFWR45ELPYAGJTA5CNFSM4EZ6UZL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWS7SOQ#issuecomment-497416506, or mute the thread https://github.com/notifications/unsubscribe-auth/ALU263GRH2KHBXUZBGHNKA3PYAGJTANCNFSM4EZ6UZLQ .