Skip to content

[✨] Persisting navbar scroll state when navigating the docs #1054

@dvir-pollinger

Description

@dvir-pollinger

Is your feature request related to a problem?

Currently, going between components in the documentation triggers a full page reload, which loses the scrolling state of the menu, which is quite annoying.

Describe the solution you'd like

The absolutely simplest solution would be to put a scroll event listener on the nav element so that nav.scrollTop will be persisted using session storage, and to initialize this value from the storage if it already exists when the page loads.
To polish this a little bit, a second value should be stored to track whether the user navigates using the nav menu, so that the scroll location will not be always used (for example, on a page refresh or navigating to the docs from outside)

Describe alternatives you've considered

Could be anything from adding a tiny js script to modifying the existing nav component

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions