Skip to content

[css-scroll-snap-2] Should snap events fired at the document bubble? #10173

@DavMila

Description

@DavMila

The scroll-snap-2 spec says that snap events ("snapchanged" & "snapchanging") should not bubble.

For snap events targeted at the document, this diverges from the behavior specified for scroll events which should bubble when targeted at the document. I believe the effect of bubbling when targeted at the document is that scroll events can also be listened to on the window.

Making snap events behave consistently with scroll events in this regard may be closer to developers' expectations since it is not uncommon for developers to listen for scrolls on a page via

window.addEventListener("scroll", () => {/* Do Stuff.*/}) or window.onscroll = () => {/* Do Stuff. */}

A developer might expect to be able to write

window.addEventListener("snapchanged", () => {/* Do Stuff.*/})

just as they would

document.addEventListener("snapchanged", () => {/* Do Stuff.*/})

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions