Skip to content

A comprehensive scrolling API #722

@WebWeWantBot

Description

@WebWeWantBot

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions