Skip to content

Commit

Permalink
Fix scrollbar errors when offset is zero (#724) (#Fixes #723)
Browse files Browse the repository at this point in the history
  • Loading branch information
pradeepnschrodinger authored Jun 24, 2024
1 parent 522e82b commit 0fd29dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/Scrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ class Scrollbar extends React.PureComponent {
// magically available for browsers somehow.
const nativeEvent = event.nativeEvent;
let position = this.state.isHorizontal
? nativeEvent.offsetX ||
nativeEvent.layerX ||
? nativeEvent.offsetX ??
nativeEvent.layerX ??
this.getTouchX(nativeEvent)
: nativeEvent.offsetY ||
nativeEvent.layerY ||
: nativeEvent.offsetY ??
nativeEvent.layerY ??
this.getTouchY(nativeEvent);

// MouseDown on the scroll-track directly, move the center of the
Expand Down

0 comments on commit 0fd29dd

Please sign in to comment.