Open
Description
Describe the bug
Opening or navigating to sidebar links should focus the sidebar item. (Similar to VSCode's "explorer.autoReveal": true
setting) Currently if sidebar is really long or out of the view port, it's not possible to know where I'm at.
Reproduction
Example 1
- Go to https://vitepress.dev/guide/sitemap-generation
- Scroll down the sidebar
- Click on the Guide text in the nav bar
- https://vitepress.dev/guide/what-is-vitepress page will be opened, but sidebar will stay in the position
Example 2
- Go to https://docs.meteor.com/packages/url.html
- Page you're seeing is listed down in the Packages > url sidebar item. But sidebar scroll position won't move.
Expected behavior
Opening sidebar link should focus on the sidebar item. If sidebar is long, it should scroll down the sidebar scroll position.
Example: Opening this page would automatically scroll down the sidebar position https://learn.microsoft.com/en-us/dotnet/fsharp/tutorials/type-providers/troubleshooting-type-providers
System Info
npmPackages:
vitepress: 1.4.1 => 1.4.1
Additional context
Not sure if it should be considered as a feature request.
Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.