From 1e430ba6947da2a03852f8a442c9c8fa809d7d2d Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Tue, 17 Nov 2015 17:30:48 +0800 Subject: [PATCH] fix: if there is no marks, `step=1` should work --- src/Slider.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Slider.jsx b/src/Slider.jsx index 87423ca..60e493b 100644 --- a/src/Slider.jsx +++ b/src/Slider.jsx @@ -235,7 +235,7 @@ class Slider extends React.Component { getPoints() { const {marks, step, min, max} = this.props; const points = new Set(Object.keys(marks)); - if (step > 1) { + if (isEmpty(marks) || step > 1) { for (let i = min; i <= max; i = i + step) { points.add(i); }