Open flackr opened 7 months ago
The CSS Working Group just discussed [css-scroll-snap] Snap point selection when scrolling into view should try to make targeted element visible
, and agreed to the following:
RESOLVED: We'll fix the problems in this issue, details TBD
The css-scroll-snap-1 6.2 Choosing Snap Positions specification does not require scrolling the target into view unless the target itself establishes a snap position. As a result, scroll snap can result in a scrollIntoView or anchor navigation not actually scrolling to the correct snap position to show the target element.
For example, consider a scroller which has pages that snap into view and each page contains items which are sometimes scroll targets. Calling scrollIntoView on a target can result in scroll snap selecting the next or previous position. See a live demo
On this example (try it in the live demo), the following issues occur: Starting from page 1,
Starting from page 2,
Starting from page 3,
I believe this affects all operations attempting to scroll elements into view.
TLDR; I think the snap point selection algorithm should require that we select the snap area which results in the target element being visible. There may be situations where there is no such snap area, in which case I think it's okay that we scroll as close as we can to the target, but this case has a clear expectation.