Skip to content

Commit

Permalink
Fix scrollTop is not always be an integer (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
aiyc666 authored Feb 13, 2021
1 parent 3142140 commit 241a723
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-swipeable-views/src/SwipeableViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ export function findNativeHandler(params) {
goingForward = !goingForward;
}

const scrollPosition = shape[axisProperties.scrollPosition[axis]];
// scrollTop is not always be an integer.
// https://github.com/jquery/api.jquery.com/issues/608
const scrollPosition = Math.round(shape[axisProperties.scrollPosition[axis]]);

const areNotAtStart = scrollPosition > 0;
const areNotAtEnd =
Expand Down

0 comments on commit 241a723

Please sign in to comment.