-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Touchable: onPress is triggered when scrolling at the top of a ScrollView #731
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
Comments
same problem, mark |
I made a glitch to try and repro this and it seems to be working as expected when using a View: https://giant-planet.glitch.me/ If you replace the |
I can't reproduce this issue either. Perhaps it is Windows-only, but that seems unlikely given the browser is Chrome. |
@jondkoon @necolas it seems bug with TouchableHighlight but not TouchableOpacity https://glitch.com/edit/#!/cultured-bracket |
I can actually reproduce this with both Touchables when you drag-down and release while still over the button. On native, the scrollview becomes the responder as soon as you start to drag after pressing on a touchable. On web, the touchable remains the responder. |
… would not prevent the onPress event of being triggered This would affect users clicking on a Touchable by accident while scrolling up or down on mobile browsers It is probably a fix for the issue necolas#731
Canceling a event by moving outside from the Touchable area would not prevent the onPress event of being triggered This would affect users clicking on a Touchable by accident while scrolling up or down on mobile browsers It is probably a fix for the issue necolas#731
Canceling a event by moving outside from the Touchable area would not prevent the onPress event of being triggered This would affect users clicking on a Touchable by accident while scrolling up or down on mobile browsers It is probably a fix for the issue necolas#731
I think I understand the root of the issue. In React Native, The reported issue goes away when |
This comment has been minimized.
This comment has been minimized.
I think custom scroller that supports momentum scroll event will solve this problem. |
I think I found something that might help to debug this. While investigating for #829, I tried to wrap my app with a ScrollView without any actual scroll (no specific height or flex). A sort of useless ScrollView, but not that useless as touch events are still triggered. It's just that scroll is never fired. We can clearly see most scroll trigger onPress, but not all. And we know it before releasing the finger. |
Closing this issue so we can coordinate findings and solutions in #1219 |
@necolas this issue is still happening with me on mobile browsers. I use this release 0.11.7 any one solved it here?? |
Update to 0.19. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
TouchableOpacity inside a ScrollView will be triggered if one try to scroll up while the ScrollView is already at its top. See the below gif for better understanding:
This also happens to horizontal ScrollView.
If the current behavior is a bug, please provide the steps to reproduce and
if a minimal demo of the problem via Glitch or similar (template:
https://glitch.com/edit/#!/react-native-web-playground).
copy paste this code:
What is the expected behavior?
TouchableOpacity should not trigger onPress when it's inside a ScrollView (with height set to screen/window height) when scrolling under any circumstances.
Environment (include versions). Did this work in previous versions?
The text was updated successfully, but these errors were encountered: