Skip to content

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

@flackr

Description

@flackr

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions