mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-24 14:36:59 +02:00
fix(v2): reset sidebar state on sidebar changes (#3418)
This commit is contained in:
parent
21852948ce
commit
17975950b2
2 changed files with 10 additions and 1 deletions
|
@ -23,7 +23,11 @@ function DocPageContent({currentDocRoute, versionMetadata, children}) {
|
|||
<div className="d-flex vh-100 overflow-hidden">
|
||||
{sidebar && (
|
||||
<div className="vh-100" role="complementary">
|
||||
<DocSidebar path={currentDocRoute.path} sidebar={sidebar} />
|
||||
<DocSidebar
|
||||
key={sidebarName}
|
||||
path={currentDocRoute.path}
|
||||
sidebar={sidebar}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<main className="vh-100 w-100 d-flex flex-column align-items-center overflow-auto p-5">
|
||||
|
|
|
@ -69,6 +69,11 @@ function DocPageContent({
|
|||
{sidebar && (
|
||||
<div className={styles.docSidebarContainer} role="complementary">
|
||||
<DocSidebar
|
||||
key={
|
||||
// Reset sidebar state on sidebar changes
|
||||
// See https://github.com/facebook/docusaurus/issues/3414
|
||||
sidebarName
|
||||
}
|
||||
sidebar={sidebar}
|
||||
path={currentDocRoute.path}
|
||||
sidebarCollapsible={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue