-
Notifications
You must be signed in to change notification settings - Fork 428
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
fix(android): prevent taps while scrolling #961
Conversation
Verified this fixes the issue in our app. |
* [Android] Fix taps triggering while swiping * Revert "[Android] Try to disambiguate taps from swipes (#7448)" This reverts commit 96054f4. * Update patch to match callstack/react-native-pager-view#961 * Make it symmetrical --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Hello 👋 Once it is rebased, we will merge it Thank you for your cooperation 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
brings this more in line with existing react patterns copied from bluesky-social/social-app@88b1878
fantastic, thank you! |
Summary
This PR fixes a bug on Android where taps sometimes incorrectly trigger while swiping between pager screens, see issues #960 and #954. These issues in turn were opened in order to investigate bluesky-social/social-app#7312
The cause of the bug seems to have had to do with React not being notified when the native pager starts scrolling, which meant that it didn't properly cancel gestures in the pager's children.
The fix involves adding a call to notifyNativeGestureStarted, whose purpose is exactly to notify JS that a native gesture has started so it can dispatch the appropriate cancel events, see its use in other similar components like ReactScrollView
This call was added to NestedScrollableHost, where scrolling canceling logic was already present, however the behavior of nested scrollables should hopefully remain unchanged.
Test Plan
I have tested the issues this PR aims to solve (#960, #954, bluesky-social/social-app#7312) and I cannot reproduce the described bugs anymore.
I have also tested all the examples in the repo, and all seem to function as expected. In particular, examples with scrollables (eg. ScrollViewInsideExample) or nested pagers (eg. NestPagerView) seem to be unaffected.
Compatibility
Checklist
README.md