From e2504d99fe845d686ac468279b5df5008cc8ed04 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Mon, 11 Jul 2016 09:53:38 +0800 Subject: [PATCH] fix: should calc cloest point correctly, close: #116 --- src/Slider.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Slider.jsx b/src/Slider.jsx index 1edcf28..310bcd9 100644 --- a/src/Slider.jsx +++ b/src/Slider.jsx @@ -270,7 +270,7 @@ class Slider extends React.Component { const points = Object.keys(marks).map(parseFloat); if (step !== null) { - const closestStep = Math.round(val / step) * step; + const closestStep = (Math.round((val - min) / step) * step) + min; points.push(closestStep); }