Skip to content

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

@hayeah

Description

@hayeah

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issueInterested in collaborating? Take a stab at fixing one of these issues.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions