Skip to content

Commit

Permalink
Merge pull request #1 from rpastorelle/master
Browse files Browse the repository at this point in the history
Bug fix: MultiSlider bottom bound can become greater than top bound
  • Loading branch information
ptomasroos committed Jul 22, 2016
2 parents c6b5a86 + b7fab7a commit d99c326
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion MultiSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export default class MultiSlider extends React.Component {
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 = positionToValue(this.state.positionOne, this.optionsArray, this.props.sliderLength);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"author": "Tomas Roos <ptomasroos@gmail.com>",
"license": "MIT",
"peerDependencies": {
"react-native": "^0.27.2",
"react-native": ">=0.27.2",
"react": "^15.1.0"
},
"devDependencies": {
Expand Down

0 comments on commit d99c326

Please sign in to comment.