Nothing Special   »   [go: up one dir, main page]

[csswg-drafts] [css-scroll-snap-1] Why does scroll-snap-align: both snap in each axis independently? (#9519)

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

== [css-scroll-snap-1] Why does scroll-snap-align: both snap in each axis independently? ==
In the [css-scroll-snap-1 spec section 4.1.1](https://drafts.csswg.org/css-scroll-snap-1/#snap-axis) it states that for the scroll-snap-axis both:
> The [scroll container](https://drafts.csswg.org/css-overflow-3/#scroll-container) [snaps](https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap) to [snap positions](https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-position) in both of its axes independently (potentially snapping to different elements in each axis).

What's the use case for this? I would expect the common case is that the author would expects the UA to snap to both axes of that element if it snaps to that element. If an author wants to snap independently on different axes (e.g. for rows and columns of a table) they can specify snap alignment in a single axis.

Use cases where you'd for sure want alignment in both axes are any sort of 2d selection UI, e.g. a 2d panning map with multiple POI that snaps to a particular POI.

This in particular makes using the snapchanged / snapchanging apis in css-scroll-snap-2 more complicated if you do want to know which element is aligned in both axes.

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


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

Received on Tuesday, 24 October 2023 15:11:18 UTC