Skip to content
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

Snap Events #1008

Open
DavMila opened this issue Apr 5, 2024 · 4 comments
Open

Snap Events #1008

DavMila opened this issue Apr 5, 2024 · 4 comments
Assignees

Comments

@DavMila
Copy link

DavMila commented Apr 5, 2024

Request for Mozilla Position on an Emerging Web Specification

@emilio
Copy link
Collaborator

emilio commented Apr 8, 2024

cc @hiikezoe. I think generally this is fine, the integration looks very similar to scroll events.

@hiikezoe
Copy link

hiikezoe commented Apr 9, 2024

Yeah, the basic idea is pretty reasonable to me. Though I don't quite understand why SnapEvent can have only one snapTargetBlock and snapTargetInline on each axis respectively. I suppose it should be a List of nodes. Anyways it should be discussed in CSSWG not here.

@flackr
Copy link

flackr commented Apr 9, 2024

Yeah, the basic idea is pretty reasonable to me. Though I don't quite understand why SnapEvent can have only one snapTargetBlock and snapTargetInline on each axis respectively. I support it should be a List of nodes. Anyways it should be discussed in CSSWG not here.

This was in fact was discussed in the CSSWG in w3c/csswg-drafts#9622

The TLDR is that when following an element after a change in layout browsers must have chosen some element to follow per https://drafts.csswg.org/css-scroll-snap-1/#re-snap so we have standarized in that issue how to choose which element is chosen (when multiple are aligned) and are exposing that chosen element in the event.

@hiikezoe
Copy link

hiikezoe commented Apr 9, 2024

Thanks for the pointer! I haven't followed the spec issue yet indeed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants