Skip to content

A comprehensive scrolling API #722

Open
@WebWeWantBot

Description

@WebWeWantBot

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/

Metadata

Metadata

Assignees

No one assigned

    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