Skip to content

A comprehensive scrolling API #722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
WebWeWantBot opened this issue Mar 21, 2025 · 0 comments
Open

A comprehensive scrolling API #722

WebWeWantBot opened this issue Mar 21, 2025 · 0 comments

Comments

@WebWeWantBot
Copy link
Collaborator


title: A comprehensive scrolling API
date: 2025-03-21T05:45:54.403Z
submitter: ExtAnimal
number: 67dcfd12c70e2900a37d771d
tags: [ ]
discussion: https://github.com/WebWeWant/webwewant.fyi/discussions/
status: [ discussing || in-progress || complete ]
related:

  • title:
    url:
    type: [ article || explainer || draft || spec || note || discussion ]

The scrollIntoView API has the block and inline settings which tell it where in the scrolling viewport the target element should be scrolled, 'start', 'center' etc. And has behavior smooth. But that is not enough for real world use cases.

You may want "space" round the target element rather than when scrolling to block : 'start' having the top touch the top of the viewport.

If the target is extremely large, you may need to ask for just the top 200 pixels of it to move into view.

And finally... Of course it should yield a Promise which resolves when the smooth scrolling has settled and the layout is in its final shape.

I have an issue outstanding: w3c/csswg-drafts#9836

Also, it does not handle sticky elements which occlude the target part of the viewport.

w3c/csswg-drafts#3104


If posted, this will appear at https://webwewant.fyi/wants/67dcfd12c70e2900a37d771d/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant