-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
Pan gesture doesn't activate for some time after scrolling the parent scrollable #3049
Comments
Hi! I've looked into your repro. The thing is, on iOS Gesture Handler uses native recognizers and in case of
That's strange, even on the video that you've attached I can see that you get both, Nagranie.z.ekranu.2024-08-16.o.11.46.53.movAs a side note, you can simplify your component like this: <ScrollView contentContainerStyle={styles.content}>
<GestureDetector gesture={panGesture}>
<Animated.View style={[styles.box, animatedStyle]} />
</GestureDetector>
</ScrollView> |
See how this can be problematic on the following recording. The ScrollView recognizes a gesture but the pan gesture doesn't call any of callbacks when the ScrollView starts handling pan: 20240816_120356.1.1.1.mp4I got it working by using the Manual gesture which I can cancel manually when I know that the pan gesture would not be handled but still it'd better if pan gesture could be handled after scroll. I understand that this might be not possible on iOS, though, so we can close this issue if nothing more can be done.
Yeah, I know I can simplify code but this is just a repro and I copy-pasted code from my other project (where I need 2 separate components), did some cleanup and didn't care about the simplest implementation. |
I don't think it is something that we will be able to achieve right now 😞 As you can see, there's no
While I can't see good solution to this problem, maybe there is one. Please leave it open until @j-piasecki responds - then we can either close it, or try something else 😅 |
The problem here is that the scroll is still technically active (if you set I think it's because we're in As for your use case, wouldn't moving the highlighting logic to As for the issue, I think we can keep it open as it should be fixable. The relevant info must exist somewhere since the pan recognizer receives |
I wanted to start the item scale change animation when it is touched with a slight delay (I used I used the Pan gesture together with the I would try to experiment with Thank you @m-bert and @j-piasecki for your explanations! |
Description
Pan gesture works usually fine inside a
ScrollView
or other component except some cases, when I try to drag an item a while after scrolling the scrollable parent container. I would expect the Pan gesture to activate in such a case as well but instead, I have to wait for a noticeable amount of time until it works again. Before this time elapses, the Pan gesture calls just theonTouchesDown
andonBegin
callbacks and no other callback is called later on (if the gesture cannot be handled, I would expect to just receive theonFinalize
callback call to handle such a case).I noticed the problem only on iOS (simulator and real device).
Example recording
Screen.Recording.2024-08-15.at.12.48.57.1.mp4
Steps to reproduce
main
branchSnack or a link to a repository
https://github.com/MatiPl01/gesture-handler-issues
Gesture Handler version
2.18.1
React Native version
0.74.5
Platforms
iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
New and Old
Build type
Debug mode
Device
iOS simulator, real device
Device model
tested on iPhone 15 Pro (real device, simulator)
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: