Moving focus into sticky header should not scroll page by scroll-padding/scroll-margin amount
Categories
(Core :: Layout: Scrolling and Overflow, defect)
Tracking
()
People
(Reporter: sime.vidas, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:94.0) Gecko/20100101 Firefox/94.0
Steps to reproduce:
This issue was reported on the web.dev repo a few months ago: https://github.com/GoogleChrome/web.dev/issues/5413
The report provides the following test page (read the instructions on that page): https://codepen.io/robdodson/pen/MWpKOOK
Actual results:
If the user presses Shift + Tab to move focus back to the sticky header, the page scrolls a bit.
Expected results:
The scroll position should not change because the sticky header is always visible.
I have found that the same issue occurs when using scroll-margin instead of scroll-adding, so the issue affects both properties.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Layout: Scrolling and Overflow' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•3 years ago
|
||
So it seems Chrome scrolls all the way to the static position (so all the way to the top), right? Not sure that's a lot better...
Reporter | ||
Comment 3•3 years ago
|
||
That’s not what I’m seeing in my Chrome (on macOS). Every time I try it, it scrolls up by exactly 176 pixels, for some reason.
So to be clear, you have to
- click once on the text where it says ”Click here”
- scroll down by a fair amount (a couple of pages) without clicking anything
- press Shift + Tab to focus the Menu button in the header
Tip: In Chrome DevTools in the Console, you can add a live expression (the eye icon). If you paste document.documentElement.scrollTop, it will always tell you the current scroll position, so it will be easier to tell by how much it changed when you press the keyboard command.
Comment 4•3 years ago
|
||
The severity field is not set for this bug.
:hiro, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 5•3 years ago
|
||
If the target sticky element is totally visible, to me any scroll operation shouldn't happen. But if the element is half visible, scroll-padding/scroll-margin should be applied?
Description
•