-
-
Notifications
You must be signed in to change notification settings - Fork 984
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
Doesn't work in a modal #139
Comments
+1 |
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 |
@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. |
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
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 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.
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. 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 ? |
same error. |
+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) |
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
<#139>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALU263GRH2KHBXUZBGHNKA3PYAGJTANCNFSM4EZ6UZLQ>
.
|
Fixes #139 Removed RNGHModalUtils This class gave access to ReactModalHostView.DialogRootViewGroup in order to call #onChildStartedNativeGesture() and use instanceof on it. Checks for ReactRootView / DialogRootViewGroup can be unified by utilizing RootView (which both of those classes implement). Always render GestureHandlerRootView This prevents gestures from not being delivered to RNGH when another GestureHandlerRootView is used before modal (e.g. from React Navigation). Note: This isn't an ideal fix since a new orchestrator will be created, preventing modals from interacting with handlers outside of them. However, this use case is rare. Having gestures working in modals is already an improvement.
@jakub-gonet When are you planning the next release with #1603 changes? |
We're planning on releasing the next version in a month or so. This is a transition from 1.x to 2.x so it may take a bit longer than usual. |
I'm trying to call the RectButton inside a modal of createStackNavigator(@react-navigation/stack), on android the RectButton doesn't trigger onPress, IOS works perfectly react-native-gesture-handler: 2.1.1 Any solution? |
Fixes software-mansion#139 Removed RNGHModalUtils This class gave access to ReactModalHostView.DialogRootViewGroup in order to call #onChildStartedNativeGesture() and use instanceof on it. Checks for ReactRootView / DialogRootViewGroup can be unified by utilizing RootView (which both of those classes implement). Always render GestureHandlerRootView This prevents gestures from not being delivered to RNGH when another GestureHandlerRootView is used before modal (e.g. from React Navigation). Note: This isn't an ideal fix since a new orchestrator will be created, preventing modals from interacting with handlers outside of them. However, this use case is rare. Having gestures working in modals is already an improvement.
Thanks a lot finally this solution worked for me. :) |
need more assistance.! can you please help me with this? |
For me, I just installed the newest version 2.4.0. And then I use GestureHandlerRootView to wrapper the PanGestureHandler. It works. Remember that don't wrapper the view or others components. Wrapper thePanGestureHandler like below:
|
This fix does make the component scrollable but it's still super glitchy on android compared to when using the same component outside of a modal. |
This happened to me too and belive it or not I solved it by setting |
Still not working on Android 👎 |
const ExampleWithHoc = gestureHandlerRootHOC(() => (
<View>
<DraggableBox />
</View>
);
);
export default function Example() {
return (
<Modal>
<ExampleWithHoc />
</Modal>
);
} |
2023, problem is still there, but this worked. Thanks! |
Thanks its working for me |
Thanks for summarising @Goowwy . Works like a charm in Android modal! You all are life savers! |
"react": "18.2.0", Wrapping the components that uses the RNGH stuff still works like a charm! Thank you so much everyone! |
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
The text was updated successfully, but these errors were encountered: