-
Notifications
You must be signed in to change notification settings - Fork 420
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
Any way to disable onPress on child views while swiping? #509
Comments
Found a solution from this answer: satya164/react-native-tab-view#1241 (comment) I wrapped TouchableOpacity in a new component that doesn't trigger onPress if any swipe beyond a threshold has occurred:
And use this in my pager views, flatlists etc. to prevent onPress being triggered when swiping. |
Thank you! This is gold. This should/could be a flag on the PagerView object: something like |
Using SDK 51 not working on android. |
I have an issue where onPress gets triggered on child views while I'm swiping in the pager view. Is there some way to prevent this from happening?
I tried tracking the pager state with the events:
But it seems like the onPress is triggered before the state of the pager view updates.
I'm using version 5.4.9 and Expo Go.
The text was updated successfully, but these errors were encountered: