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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export default class Slider extends PureComponent {

_handleStartShouldSetPanResponder = (e: Object, /*gestureState: Object*/): boolean => {
// Should we become active when the user presses down on the thumb?
return this._thumbHitTest(e);
return !this.props.disabled && this._thumbHitTest(e);
};

_handleMoveShouldSetPanResponder(/*e: Object, gestureState: Object*/): boolean {
Expand All @@ -318,10 +318,6 @@ export default class Slider extends PureComponent {
};

_handlePanResponderMove = (e: Object, gestureState: Object) => {
if (this.props.disabled) {
return;
}

this._setCurrentValue(this._getValue(gestureState));
this._fireChangeEvent('onValueChange');
};
Expand All @@ -332,10 +328,6 @@ export default class Slider extends PureComponent {
};

_handlePanResponderEnd = (e: Object, gestureState: Object) => {
if (this.props.disabled) {
return;
}

this._setCurrentValue(this._getValue(gestureState));
this._fireChangeEvent('onSlidingComplete');
};
Expand Down