Re: [csswg-drafts] [css-scroll-snap-2] Should scrollsnapchanging target the currently visible element during flings (#10838)

Okay, I've put together a demo that lets you compare two strategies for scrollsnapchanging (use chrome canary with experimental web platform features enabled):
https://flackr.github.io/web-demos/css-scroll-snap/scrollsnapchanging/index.html

In the demo, you can select from:
1. Native: This uses the platform scrollsnapchanging events - e.g. in chrome canary this is currently the predicted end of scroll location.
2. None: Turns off that highlight
3. Current location: Closest snap point based solely on the current scroll location
4. Targeted location: Uses the targeted location of a programmatic scroll call, but otherwise uses closest.

I propose that the targeted location is better than the current native behavior. In particular, when you fling the native behavior jumps ahead by several items quickly. Using the targeted location instead of always using the current location is necessary to ensure that clicking on a particular location immediately selects it.

-- 
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10838#issuecomment-2502955153 using your GitHub account


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

Received on Wednesday, 27 November 2024 06:00:19 UTC