From 43da844881a6ea1b346957b9772c3ececf633713 Mon Sep 17 00:00:00 2001 From: Ryan Pastorelle Date: Tue, 19 Jul 2016 13:29:31 -0400 Subject: [PATCH] Fix a logic error: When the top position is 0, the responder allows bottom to move above top. --- Slider.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Slider.js b/Slider.js index 9dc6b44..a89a02f 100644 --- a/Slider.js +++ b/Slider.js @@ -132,7 +132,8 @@ var Slider = React.createClass({ moveOne(gestureState) { var unconfined = gestureState.dx + this.state.pastOne; var bottom = 0; - var top = (this.state.positionTwo - this.stepLength) || this.props.sliderLength; + var trueTop = this.state.positionTwo - this.stepLength; + var top = (trueTop === 0) ? 0 : trueTop || this.props.sliderLength; var confined = unconfined < bottom ? bottom : (unconfined > top ? top : unconfined); var value = converter.positionToValue(this.state.positionOne, this.optionsArray, this.props.sliderLength);