Skip to content

Question about current status of scroll-padding / scroll-margin #831

@floer32

Description

@floer32

I saw this mentioned in an earlier issue (#292):

I plan on implementing scroll-margin and scroll-padding support next, as these properties are no longer exclusive to scroll-snap logic but also affect scrollIntoView and page fragment scrolling in firefox and chrome betas.

And I gather that explicit support has not been implemented yet, based on searching the source code.

I noticed that, without the polyfill, I can use .scrollIntoView in Chrome (just without the if-needed option), and it's working as I expect, taking scroll-padding-top into account. So my solution for now is: in Chrome, just call that native method, but if we are in Safari/Edge (or if that method had an error), it uses this polyfill (even though some content will be covered by the fixed header, since scroll-padding/scroll-margin is not accounted-for yet).

Is that basically the right idea in the meantime?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions