-
Notifications
You must be signed in to change notification settings - Fork 24.1k
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
[ScrollView] Shouldn't become responder if scrollEnabled is false #2411
Comments
Addresses: facebook#2411 Using the scrollTo method to programmatically scroll a scrollView causes it to mistakenly think a user-initiated scroll event occurred, so it tries to steal the responder status from another active responder.
@hayeah awesome demo! I was looking for a solution like this. Is the code open sourced for the sortable list? |
👍 |
@vjeux @brentvatne @ide @spicyj |
Hi there! This issue is being closed because it has been inactive for a while. But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/scrollview-shouldnt-become-responder-if-scrollenabled-is-false ProductPains helps the community prioritize the most important issues thanks to its voting feature. Also, if this issue is a bug, please consider sending a PR with a fix. |
I am doing a sortable list proof-of-concept with ReactNative. One of the effects I want to achieve is to auto-scroll a long list if the dragged item is near the bottom (or top) of the screen. Like so:
To prevent scroll view from scrolling while an item is dragged, I set ScrollView's "scrollEnabled" prop to false, which seems to do the trick. The only problem is if I use the
scrollTo
method to programmatically scroll, the scrollView mistakenly thinks a user-initiated scroll event occurred, and tries to steal the responder status.The chain of events is illustrated by these diagrams:
The way to fix this problem is to check whether scrollEnabled is false in scrollResponderHandleScrollShouldSetResponder.
The text was updated successfully, but these errors were encountered: