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

Snapevents #1522

Open
hvanops opened this issue Jul 29, 2024 · 0 comments
Open

Snapevents #1522

hvanops opened this issue Jul 29, 2024 · 0 comments
Labels
feature definition Creating or defining new features or groups of features.

Comments

@hvanops
Copy link

hvanops commented Jul 29, 2024

Specification

Spec review for Snap Events · Issue #943 · w3ctag/design-reviews · GitHub

Description

Snap Events allow developers to reliably listen for when the "snap target" of a scroller changes and perform style adjustments as desired.

CSS scroll snap points are often used as a mechanism to create scroll interactive "selection" components, where selection is determined with javascript intersection observers and a scroll end guesstimate. By creating built-in events, the invisible state will become actionable, at the right time, and always correct. This feature adds two JavaScript events:

  • Snapchanging: This event gives developers a hint during a scroll operation that the user agent intends to snap the scroll container to a new snap target based on the scrolling input so far.

  • Snapchanged: This event lets developers know that the element to which a scroller is snapped has changed, and fires at the completion of a scroll operation (including snapping)

Browser support

No response

@hvanops hvanops added the feature definition Creating or defining new features or groups of features. label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature definition Creating or defining new features or groups of features.
Projects
None yet
Development

No branches or pull requests

1 participant