Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dvir-pollinger opened this issue Mar 10, 2025 · 0 comments
Open

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

dvir-pollinger opened this issue Mar 10, 2025 · 0 comments
Labels
STATUS-1: needs triage This doesn't seem right TYPE: enhancement New feature or request

Comments

@dvir-pollinger
Copy link

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

@dvir-pollinger dvir-pollinger added STATUS-1: needs triage This doesn't seem right TYPE: enhancement New feature or request labels Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage This doesn't seem right TYPE: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant