mirror of
https://github.com/wassname/slider.git
synced 2026-09-11 12:42:49 +08:00
fix: should calc cloest point correctly, close: #116
This commit is contained in:
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user