Skip to content

Specify scrollable element for scroll behavior #1609

@Calneideck

Description

@Calneideck

What problem does this feature solve?

The savedPosition prop of scrollBehavior gets its left/top values from the window. This is an issue for pages where the main scrollable area is on another element and not the body. In these cases it will always return (0,0) making it impossible to get the last known scroll position.

What does the proposed API look like?

It would be great to have an optional element or id selector to pass into createRouter which is used in computeScrollPosition to save the scroll position of the specified element.

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