docs: improvement to sidebar (#11810)
* docs: improvement to sidebar * fix sidebar
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user