mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-24 06:27:02 +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">
|
<div className="d-flex vh-100 overflow-hidden">
|
||||||
{sidebar && (
|
{sidebar && (
|
||||||
<div className="vh-100" role="complementary">
|
<div className="vh-100" role="complementary">
|
||||||
<DocSidebar path={currentDocRoute.path} sidebar={sidebar} />
|
<DocSidebar
|
||||||
|
key={sidebarName}
|
||||||
|
path={currentDocRoute.path}
|
||||||
|
sidebar={sidebar}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<main className="vh-100 w-100 d-flex flex-column align-items-center overflow-auto p-5">
|
<main className="vh-100 w-100 d-flex flex-column align-items-center overflow-auto p-5">
|
||||||
|
|
|
@ -69,6 +69,11 @@ function DocPageContent({
|
||||||
{sidebar && (
|
{sidebar && (
|
||||||
<div className={styles.docSidebarContainer} role="complementary">
|
<div className={styles.docSidebarContainer} role="complementary">
|
||||||
<DocSidebar
|
<DocSidebar
|
||||||
|
key={
|
||||||
|
// Reset sidebar state on sidebar changes
|
||||||
|
// See https://github.com/facebook/docusaurus/issues/3414
|
||||||
|
sidebarName
|
||||||
|
}
|
||||||
sidebar={sidebar}
|
sidebar={sidebar}
|
||||||
path={currentDocRoute.path}
|
path={currentDocRoute.path}
|
||||||
sidebarCollapsible={
|
sidebarCollapsible={
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue