-
Notifications
You must be signed in to change notification settings - Fork 4.4k
chore: reduce scrolling during clicks #36175
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
Conversation
Existing logic always tries to scroll to a different position after clicking at a wrong hit target. This is done to scroll out from under a sticky/fixed header. However, it does not make sense to scroll if the sticky/fixed header is not a parent of the wrong hit target element, or is a common parent of the hit target and the actual target element. This change restricts the scrolling logic to be only applied when there is a sticky/fixed element in the DOM chain between the hit target and its least common ancestor with the target element.
16d13ae
to
eefa0ae
Compare
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"4 flaky39286 passed, 818 skipped Merge workflow run. |
Test results for "tests others"1 fatal errors, not part of any test 3 flaky19992 passed, 467 skipped Merge workflow run. |
Test results for "tests 2"1 fatal errors, not part of any test 139 flaky235959 passed, 9420 skipped Merge workflow run. |
This reverts commit 8d27a06. New test is added to cover the regression.
Existing logic always tries to scroll to a different position after clicking at a wrong hit target. This is done to scroll out from under a sticky/fixed header.
However, it does not make sense to scroll if the sticky/fixed header is not a parent of the wrong hit target element, or is a common parent of the hit target and the actual target element.
This change restricts the scrolling logic to be only applied when there is a sticky/fixed element in the DOM chain between the hit target and its least common ancestor with the target element.