docs: improvement to sidebar (#11810)

* docs: improvement to sidebar

* fix sidebar
This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-03-11 16:48:01 +02:00
1 parent e0277e375e
commit ef66ff8f99
3 files changed
+33 -26

No files matched your search

@@ -301,7 +301,7 @@ export const SidebarProvider = ({
}, [scrollableElement, isBrowser])
const activeMainSidebar = useMemo(() => {
if (!activePath) {
if (!activePath || sidebars.length === 1) {
// set first sidebar as active
return sidebars[0]
}
@@ -357,7 +357,7 @@ export const SidebarProvider = ({
const shownSidebar = useMemo(() => {
if (!sidebarHistory.length) {
return
return sidebars.length === 1 ? sidebars[0] : undefined
}
return getSidebar(sidebarHistory[sidebarHistory.length - 1])