Focused element is not scrolled into view when centered in a scroll-snap container child
Categories
(Core :: DOM: UI Events & Focus Handling, enhancement)
Tracking
()
People
(Reporter: red.idea3320, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/116.0
Steps to reproduce:
When using scroll-snap focusable elements are not always scrolled into view. This appears to happen when the content is centred within a child of a scroll container.
- Create a scroll container with scroll-snap-type: both mandatory
- Center the content of the scroll container children using text alignment or another method
- Set scroll-snap-align: start on the scroll containers children
- Use the tab key to navigate through the focusable elements in the scroll container.
A reproduction of the issue can be seen here:
In scenarios 1 and 2 without scroll snap the focused elements are scrolled into view.
In scenarios 3 and 4 with scroll snap the focused elements aren't scrolled into view.
https://codepen.io/rynpsc/full/xxQoWVj
Actual results:
When an element is focused the scroll position of the scroll container is changed but the focused element remains out of view.
Expected results:
When an element is focused the element or scroll item should be scrolled into view as in Chrome and Safari.
Reporter | ||
Updated•1 year ago
|
Reporter | ||
Updated•1 year ago
|
Description
•