w3c / w3c/csswg-drafts

[css-scroll-snap] Difficult to use snap areas which are larger than the scrollport

Open
#6,863 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Closed Accepted as Editorial Commenter Response Pending css-scroll-snap-1
Dominant language
Bikeshed
Stars
4.9k
Forks
816
Avg merge
2d 18h
Merged PRs (30d)
24

Description

The css-scroll-snap spec makes it possible for snap areas larger than the scrollport to be accessed, however, the behavior in many browsers makes it quite difficult and results in unexpected scrolls. For example, If you test the examples on https://output.jsbin.com/pojeyeg it is difficult to reach the end of a snap area without snapping to the next. Also, it is difficult to get to the previous element in the scroll port unless you scroll very far such that the top / left of the element is closer than the current one. In a more extreme example it is very difficult to scroll to the previous item unless you fling.

I think we should update the spec to consider the entire area of valid snap positions (per css-scroll-snap section 5.2.2) when determining which snap point to snap to, and only snap as far as necessary to reach that next valid snap point rather than returning to the start of the oversized snap area.

@kevers-google do you have additional thoughts about what the spec text should look like.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the CSS Scroll Snap spec sections on snap overflow and valid snap positions, then reproduce the behavior in the linked JSBin examples. Compare the current wording with the proposed handling of oversized snap areas; done means an agreed, precise spec change that addresses the reported scrolling cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.