[csswg-drafts] [overflow-5] Allowing markers to be active even when not scrollable to aligned position. (#10738)

flackr has just created a new issue for https://github.com/w3c/csswg-drafts:

== [overflow-5] Allowing markers to be active even when not scrollable to aligned position. ==
There are many situations in which it may not be possible to scroll to a position that aligns with the natural scrolling position of every marker. For example, in https://flackr.github.io/carousel/examples/carousel/thumbnails/ is is not possible to scroll to a position that centers the first two or last two items. E.g.

In the following scrolling element, it is not possible to scroll the first two boxes to their center snap aligned position:
![scroller](https://github.com/user-attachments/assets/817bcb59-03c5-4fc5-9c98-894cf38c1a92)

This means that if the active marker is determined solely by the item closest to being aligned https://drafts.csswg.org/css-overflow-5/#scroll-container-scroll it will not be possible to show the first two / last two as active.

Should we consider a model where the browser tracks the actual element that has requested to be scrolled into view? This would allow the edge elements to show as active when clicking on those markers. This could have additional benefits if we treat this element as the anchor node for [anchor node selection](https://drafts.csswg.org/css-scroll-anchoring/#anchor-node-selection) as well. Note that subsequent user scrolling would likely undo the active styling.

Alternately, if we can't solve this in a nice way we could add a note recommending authors avoid these situations by:
* adding padding to the edges of their scrolling element, or
* ensuring their scroll marker elements are scrollport sized, or
* enabling infinite / cyclical scrolling as in #5411

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10738 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 13 August 2024 17:13:18 UTC