Skip to content

[css-scroll-snap-2] Should SnapEvents report multiple aligned targets? #10185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DavMila opened this issue Apr 9, 2024 · 2 comments
Closed

Comments

@DavMila
Copy link
Contributor

DavMila commented Apr 9, 2024

The snap events spec defines the SnapEvent interface as representing only one snapped-to element in each axis. However, it is possible for multiple elements to be visually snapped to, even if a user-agent internally selects only one target. E.g. in this codepen snapping to align to any box also makes the scroller snap-aligned to the other boxes in the row.

It would be good to get a resolution on whether SnapEvents should report all the visually-aligned targets or just the one the user-agent has internally picked.

When a layout change occurs such that previously aligned snap areas are no longer aligned, the scroller will follow the snap area that was selected as the snap target, so it might be better to have SnapEvents expose this single target so that a developer can tell which snap area would be followed through a layout change and style/animate/highlight their snap areas accordingly.

@flackr
Copy link
Contributor

flackr commented Apr 9, 2024

I believe we already agreed in #9622 that we should expose the single element, it was the first part of the issue.

@DavMila
Copy link
Contributor Author

DavMila commented Apr 10, 2024

Thanks for the pointer. Closing this as Won't fix.

@DavMila DavMila closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants