w3c / w3c/csswg-drafts

[css-scroll-snap] Programmatically scroll to snap points

Open
#8,558 3 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-scroll-snap-2
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

@Schepp mentioned in #156 that he'd like to have a way to programmatically scroll to a certain snap point.

There are indeed use cases in which authors may want more explicit control over the scroll position when scrolling with a scroll container. E.g. scrolling to a specific image in a gallery.

A possible solution for that would be to reuse the scrollTo() function for that. Its ScrollToOptions dictionary could be extended by a new option indicating a snap point.

Sebastian

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

Start by reading the css-scroll-snap material and the linked CSSOM View scrollTo() definition. Determine how an additional ScrollToOptions member could identify a snap point and what behavior is required for galleries and other scroll containers. Done means the proposal has a settled API and specified behavior.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.