-
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
Conversation
const isVerticalScrolling = Math.abs(event.deltaY) > 3; // This is for touchpads sensitive | ||
if ((event.currentTarget === node) && horizontalOverflow && !isVerticalScrolling) { |
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.
const isVerticalScrolling = Math.abs(event.deltaY) > 3; // This is for touchpads sensitive | |
if ((event.currentTarget === node) && horizontalOverflow && !isVerticalScrolling) { | |
if ((event.currentTarget === node) && horizontalOverflow && event.deltaX !== 0) { |
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 comment
The 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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
@parasharrajat and if we only do this event.deltaX !== 0
the scroll will not be smooth. Tested on touchpad.
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.
Ok, I tested it. Looking fine to me. Add a comment instead This is for touchpads sensitive
like you did https://github.com/Expensify/App/pull/9026/files#r873936354
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 More detailed comment added. PR is ready 👍
Please merge main. |
@parasharrajat merged main and comitted 👍 |
/* 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. */ |
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.
/* 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. */ | |
/* 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. */ |
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
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.
LGTM. Skipping video check for all platforms as this is part of old PR.
cc: @NikkiWines
🎀 👀 🎀 C+ reviewed
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.
Works great, one minor comment
@@ -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) { | |||
/* Scrolling horizontally with two fingers on the touchpads, |
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.
I think this comment could be a little shorter/clearer. Maybe something like:
// Account for vertical scrolling variation when horizontally scrolling via touchpad by checking a large delta.
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.
I think this comment could be a little shorter/clearer. Maybe something like:
// Account for vertical scrolling variation when horizontally scrolling via touchpad by checking a large delta.
@NikkiWines comment refactored. PR is ready 👍
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.
👍
🚀 Deployed to staging by @NikkiWines in version: 1.1.63-2 🚀
|
🚀 Deployed to production by @AndrewGable in version: 1.1.63-2 🚀
|
Attention
This PR Duplicated of #8790 . Duplicated for hotfix #7497 (comment). @parasharrajat
Details
Issue: When vertically scroll the horizontal scrollable code block then code blocks block the main scroll operation.
Fixed Issues
$ https://github.com/Expensify/App/issues/7497
Tests
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followed/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
Screenshots
Ekran.Kaydi.2022-05-16.18.55.03.mp4