Skip to content

Commit af77a4c

Browse files
fix dragabbleTrack for non-default ranges (#760)
1 parent 55a662b commit af77a4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Range.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ class Range extends React.Component<RangeProps, RangeState> {
276276
pos = props.reverse ? -pos : pos;
277277
const max = maxValue - Math.max(...startBounds);
278278
const min = minValue - Math.min(...startBounds);
279-
const ratio = Math.min(Math.max(pos / (this.getSliderLength() / 100), min), max);
279+
const ratio = Math.min(Math.max(pos / (this.getSliderLength() / (maxValue - minValue)), min), max);
280280
const nextBounds = startBounds.map((v) =>
281281
Math.floor(Math.max(Math.min(v + ratio, maxValue), minValue)),
282282
);

0 commit comments

Comments
 (0)