Skip to content

Commit

Permalink
fix dragabbleTrack for non-default ranges (#760)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhinavVishak committed Apr 21, 2021
1 parent 55a662b commit af77a4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Range.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class Range extends React.Component<RangeProps, RangeState> {
pos = props.reverse ? -pos : pos;
const max = maxValue - Math.max(...startBounds);
const min = minValue - Math.min(...startBounds);
const ratio = Math.min(Math.max(pos / (this.getSliderLength() / 100), min), max);
const ratio = Math.min(Math.max(pos / (this.getSliderLength() / (maxValue - minValue)), min), max);
const nextBounds = startBounds.map((v) =>
Math.floor(Math.max(Math.min(v + ratio, maxValue), minValue)),
);
Expand Down

1 comment on commit af77a4c

@vercel
Copy link

@vercel vercel bot commented on af77a4c Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.