-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message list not vertically scrolling while mouse over horizontal scrollable code blocks (#7497) is fixed [Duplicate for vertical scroll hotfix] #9026
Changes from 3 commits
33e08d7
7146981
0f9972a
36d72b7
ced4039
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -31,7 +31,11 @@ class PreRenderer extends React.Component { | |||||||
const node = this.ref.getScrollableNode(); | ||||||||
const horizontalOverflow = node.scrollWidth > node.offsetWidth; | ||||||||
|
||||||||
if ((event.currentTarget === node) && horizontalOverflow) { | ||||||||
/* if the user scrolls horizontally while scrolling with two fingers on the touchpads, | ||||||||
the fingers may go up a little during that scroll, and the page will start to scroll | ||||||||
vertically due to this going up. With this sensitive we eliminate this bug. */ | ||||||||
const isVerticalScrolling = Math.abs(event.deltaY) > 3; // This is for touchpads sensitive | ||||||||
if ((event.currentTarget === node) && horizontalOverflow && !isVerticalScrolling) { | ||||||||
Comment on lines
+35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
What if only do this? What benefit do we get from checking scroll sensitivity? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat Because even if the user scrolls horizontally while scrolling with two fingers on the touchpads, the fingers may go up a little during that scroll, and the page will start to scroll vertically due to this going up. With this sensitive i eliminated this bug. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, let me test this behavior. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat and if we only do this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I tested it. Looking fine to me. Add a comment instead There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat More detailed comment added. PR is ready 👍 |
||||||||
node.scrollLeft += event.deltaX; | ||||||||
event.preventDefault(); | ||||||||
event.stopPropagation(); | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parasharrajat Refactored. PR is ready