Skip to content

Commit

Permalink
Merge pull request #188 from ihmeuw/bug/slider-range-check
Browse files Browse the repository at this point in the history
Fix bug with slider so that 0 can be a part of the range
  • Loading branch information
kbeame authored Oct 8, 2019
2 parents 6ce6832 + 3832af9 commit acac9f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ui/slider/src/slider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import classNames from 'classnames';
import { scaleLinear } from 'd3';
import bindAll from 'lodash/bindAll';
import difference from 'lodash/difference';
import isNil from 'lodash/isNil';
import identity from 'lodash/identity';
import inRange from 'lodash/inRange';
import map from 'lodash/map';
Expand Down Expand Up @@ -136,7 +137,7 @@ export default class Slider extends React.PureComponent {
// Check that the mouse X pos is within the handle extent,
// and that the computed value is in the range list
if (!inRange(pageX - handleExtent, nextPos - handleExtent)
|| !this.state.range[index]) return;
|| isNil(this.state.range[index])) return;

this.updateValueFromEvent(event, index, key, this.props.onDrag);
};
Expand Down

0 comments on commit acac9f2

Please sign in to comment.