Commit 2905f32
authored
fix: Docs sidebar auto-scroll not working on page navigation (#2350)
Previously, when navigating between documentation pages using the
`command palette (⌘K)`, the sidebar would not automatically scroll to
highlight the current page location. This made it difficult to maintain
context of where you were in the documentation structure.
This PR enhances the `DocsSidebarAutoscroll` component to respond to
navigation changes by:
- Adding pathname dependency to useLayoutEffect
- Making the sidebar auto-scroll to the active page whenever navigation
occurs
- Maintaining the same smooth scrolling behavior as the initial page
load
Now the sidebar will properly scroll to the current documentation page
regardless of how you navigate to it - whether through direct clicks or
command palette navigation.1 parent 2a68a4b commit 2905f32
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | | - | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
0 commit comments