Skip to content

Commit

Permalink
refactored comment
Browse files Browse the repository at this point in the history
  • Loading branch information
orkunkarakus committed May 18, 2022
1 parent 36d72b7 commit ced4039
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ class PreRenderer extends React.Component {
const node = this.ref.getScrollableNode();
const horizontalOverflow = node.scrollWidth > node.offsetWidth;

/* Scrolling horizontally with two fingers on the touchpads,
the fingers may go up a little during that scroll, and the page will
start to scroll vertically. We eliminate this bug by checking the large delta. */
// Account for vertical scrolling variation when horizontally scrolling via touchpad by checking a large delta.
const isVerticalScrolling = Math.abs(event.deltaY) > 3; // This is for touchpads sensitive
if ((event.currentTarget === node) && horizontalOverflow && !isVerticalScrolling) {
node.scrollLeft += event.deltaX;
Expand Down

0 comments on commit ced4039

Please sign in to comment.