vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.22k stars 2.13k forks source link

Opening or navigating to sidebar links should focus/scroll to the sidebar item #4296

Open shinebayar-g opened 1 month ago

shinebayar-g commented 1 month ago

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

Example 2

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

shinebayar-g commented 2 weeks ago

Is there any workaround that I can use for now? :face_holding_back_tears: