Skip to content

Commit

Permalink
Merge pull request #9026 from orkunkarakus/fix/7497-LongLinesInCode
Browse files Browse the repository at this point in the history
Message list not vertically scrolling while mouse over horizontal scrollable code blocks (#7497) is fixed [Duplicate for vertical scroll hotfix]
  • Loading branch information
NikkiWines authored May 18, 2022
2 parents b3d2a94 + ced4039 commit 20c1174
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class PreRenderer extends React.Component {
const node = this.ref.getScrollableNode();
const horizontalOverflow = node.scrollWidth > node.offsetWidth;

if ((event.currentTarget === node) && horizontalOverflow) {
// 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;
event.preventDefault();
event.stopPropagation();
Expand Down

0 comments on commit 20c1174

Please sign in to comment.