PSA: Improved covering and nested scroll snap handling

30 views
Skip to first unread message

Robert Flack

unread,
Aug 30, 2023, 3:49:28 PM8/30/23
to blink-dev
Hi blink-dev,

We have been landing several improvements to the physics of scroll snap handling for edge cases around nested snap areas and covering (larger than the viewport) snap areas in M118:
  1. Preserving native fling momentum in covering snap areas
  2. Only scroll as far as necessary for large snap point to cover viewport (WIP)
  3. Better snapping between / outside of nested snap areas
These improvements should not be noticeable to developers, and should improve the user experience, though a developer could indirectly observe differences in resting scroll positions. We're landing use counters for nested snap areas and covering snap areas to both estimate the potential number of sites impacted by these changes and evaluate the ongoing adoption of these particular use cases.

Scrolling physics is not part of the spec but should be self-consistent within a large snap as outside of it (#1). We also believe the other two changes are in compliance with the spec and in the spirit of the spec, if not yet explicitly required. Minimizing scroll when moving into covering points was always intended and made more clear (#2). The behavior around #3 is both implied by examples 8 and 9 in the spec, suggested in comments, and we have opened an issue to make it explicit.

We hope that enabling more experiences using the browser's snap implementation will reduce the dependence on third party javascript libraries driving scroll based sites.

Thanks,
Rob
Reply all
Reply to author
Forward
0 new messages