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

Don't set PanResponder if Slider is disabled #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zachkirsch
Copy link

Currently, when the Slider is disabled, onSlidingStart() is called when the user touches the Slider, but onSlidingComplete() is never called. This behavior is a bit inconsistent.

With this PR, when Slider is disabled, the Slider will not register any touch events (neither onSlidingStart() nor onSlidingComplete() are called). Another solution is to call onSlidingStart() when the user touches the slider and onSlidingComplete() when the slider is released (regardless of whether the Slider is disabled).

I took my approach since when the Slider is disabled, no sliding can take place, so there's no concept of a slide "starting" or "completing." A benefit of the other approach is that it makes it easy to respond when a user tries to slide the Slider when it's disabled.

If you'd prefer approach #2, I'm happy to modify the PR.

If you think things are best how they are now, I think the README should be updated to clarify the behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant