Skip to content

Commit

Permalink
fix(scrollview): make scrollbars move smoother
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Bien committed Dec 6, 2020
1 parent e77d7bf commit 0d4f3f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ScrollView/ScrollView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ const ScrollView = ({

const thumbPosition = Math.max(
0,
Math.min(100 - scrollElementHeightPercent, Math.round(scrollPerc || 0)),
Math.min(
100 - scrollElementHeightPercent,
parseFloat((scrollPerc || 0).toFixed(3)),
),
);

const moveScroll = (direction: -1 | 1) => {
Expand Down

0 comments on commit 0d4f3f0

Please sign in to comment.