fix: if there is no marks, step=1 should work

This commit is contained in:
Benjy Cui
2015-11-18 14:32:56 +08:00
parent f29894e690
commit 1e430ba694
+1 -1
View File
@@ -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);
}