[csswg-drafts] [css-scroll-snap-1] expected behavior when scrolling past a container's last visible element (#4111)

justingrant has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-scroll-snap-1] expected behavior when scrolling past a container's last visible element ==
What's expected behavior when scroll snap is enabled and the user tries to scroll past the last snap position?  Example: https://codepen.io/anon/pen/orOmeP.  I'm asking because: 
* WebKit (Mac Safari, iOS any) will scroll to the end, leaving nothing visible in the viewport.
* Blink (desktop Chrome) will refuse to scroll past the last visible element.

Which is correct?  Or is this behavior currently unspecified?

FWIW, the current WebKit behavior causes a race condition that breaks current "virtual scrolling" implementations like Facebook's [react-window](https://github.com/bvaughn/react-window) that use JavaScript to JIT add/move absolutely-positioned elements in an otherwise-empty, very long container to simulate scrolling through a long list. Safari will scroll to the end of the content before the virtual-scrolling script has a chance to move elements to the user's new scroll position.  Desktop Chrome doesn't have this problem.

If this behavior isn't specified today, then I'd suggest adopting the Chrome behavior as default in the standard. If it is specified, then is there any standardized way for infinite-scroll implementations to get the Chrome behavior?


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4111 using your GitHub account

Received on Saturday, 13 July 2019 01:20:33 UTC