Skip to content
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

Closed
hayeah opened this issue Aug 23, 2015 · 6 comments
Closed

[ScrollView] Shouldn't become responder if scrollEnabled is false #2411

hayeah opened this issue Aug 23, 2015 · 6 comments
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Resolution: Locked This issue was locked by the bot.

Comments

@hayeah
Copy link
Contributor

hayeah commented Aug 23, 2015

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:

sortable-list-native-demo

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:

scrollview-responder-stealing

The way to fix this problem is to check whether scrollEnabled is false in scrollResponderHandleScrollShouldSetResponder.

@ide
Copy link
Contributor

ide commented Aug 23, 2015

cc @jordwalke @spicyj

hayeah added a commit to hayeah/react-native that referenced this issue Aug 23, 2015
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.
@chirag04
Copy link
Contributor

@hayeah awesome demo! I was looking for a solution like this. Is the code open sourced for the sortable list?

@hayeah
Copy link
Contributor Author

hayeah commented Aug 23, 2015

@chirag04
Copy link
Contributor

👍

@brentvatne brentvatne added the Good first issue Interested in collaborating? Take a stab at fixing one of these issues. label Sep 13, 2015
@bakso
Copy link

bakso commented Nov 29, 2015

@vjeux @brentvatne @ide @spicyj
Awesome demo! I was looking for a solution like this, do you have a solution for this situation now?

@mkonicek
Copy link
Contributor

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.
It is easy to use - just login with GitHub.

Also, if this issue is a bug, please consider sending a PR with a fix.
We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants