diff --git a/src/Slider.jsx b/src/Slider.jsx index 3078a50..22919bc 100644 --- a/src/Slider.jsx +++ b/src/Slider.jsx @@ -46,13 +46,7 @@ class Slider extends React.Component { let recent; if (props.range && upperBound === lowerBound) { - if (lowerBound === max) { - recent = 'lowerBound'; - } else if (upperBound === min) { - recent = 'upperBound'; - } else { - recent = 'upperBound'; - } + recent = lowerBound === max ? 'lowerBound' : 'upperBound'; } else { recent = 'upperBound'; } diff --git a/src/Steps.jsx b/src/Steps.jsx index 5b7a2b5..208f10a 100644 --- a/src/Steps.jsx +++ b/src/Steps.jsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import warning from 'warning'; function calcPoints(vertical, marks, dots, step, min, max) { - warning(dots ? step : true, '`Slider[step]` should be a positive number in order to make Slider[dots] work.'); + warning(dots ? step > 0 : true, '`Slider[step]` should be a positive number in order to make Slider[dots] work.'); const points = Object.keys(marks).map(parseFloat); if (dots) { for (let i = min; i <= max; i = i + step) {