Open Bug 1848403 Opened 1 year ago Updated 1 year ago

Focused element is not scrolled into view when centered in a scroll-snap container child

Categories

(Core :: DOM: UI Events & Focus Handling, enhancement)

Firefox 116
ARM64
macOS
enhancement

Tracking

()

UNCONFIRMED

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.

  1. Create a scroll container with scroll-snap-type: both mandatory
  2. Center the content of the scroll container children using text alignment or another method
  3. Set scroll-snap-align: start on the scroll containers children
  4. 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.

Summary: Focused element is not scrolled into view when centered in a scroll container child → Focused element is not scrolled into view when centered in a scroll-snap container child
OS: Unspecified → macOS
Hardware: Unspecified → ARM64
You need to log in before you can comment on or make changes to this bug.