-
Notifications
You must be signed in to change notification settings - Fork 206
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
fix(tabs): prevent vertical auto scroll #4613
Conversation
Tachometer resultsChrometabs permalinkbasic-test
top-nav permalinkbasic-test
Firefoxtabs permalinkbasic-test
top-nav permalinkbasic-test
|
Lighthouse scores
What is this?Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on Transfer Size
Request Count
|
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
* chore(tabs): updated tabs overflow to fix scroll into view for horizontal scroll * chore(tabs): updated golden image cache --------- Co-authored-by: Rajdeep Chandra <rajdeepchandra@Rajdeeps-MacBook-Pro-2.local> Co-authored-by: Rajdeep Chandra <rajdeepchandra@rajdeeps-mbp-2.macromedia.com>
* chore(tabs): updated tabs overflow to fix scroll into view for horizontal scroll * chore(tabs): updated golden image cache --------- Co-authored-by: Rajdeep Chandra <rajdeepchandra@Rajdeeps-MacBook-Pro-2.local> Co-authored-by: Rajdeep Chandra <rajdeepchandra@rajdeeps-mbp-2.macromedia.com>
* chore(tabs): updated tabs overflow to fix scroll into view for horizontal scroll * chore(tabs): updated golden image cache --------- Co-authored-by: Rajdeep Chandra <rajdeepchandra@Rajdeeps-MacBook-Pro-2.local> Co-authored-by: Rajdeep Chandra <rajdeepchandra@rajdeeps-mbp-2.macromedia.com>
Description
Possible fix for #4590
The problem with
scrollIntoView
is that we can not specify the direction of scroll, therefore it scrolls vertically as well, and the function is called all the time, even if you don't actually need to scroll.This implementation provides an alternative, with validations before scrolling, but unfortunately a lot of checks needed (RTL / LTR, take into account the space between the Tabs and the arrows).
Related issue(s)
Motivation and context
Replaces
scrollIntoView
with calculations based of scroll offsets.A follow-up of #4032.
How has this been tested?
selected
control, enter the number of a tab which is not visible.container
class amargin-top of 1000px
, or whatever value is needed so that the tabs are no longer into viewselected
control, change theselected
value, you can choose a number from 1 to 20selected
control, enter the number of a tab which is not visibleScreenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.