Skip to content

Commit

Permalink
fix(v2): reset sidebar state on sidebar changes (#3418)
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber authored Sep 7, 2020
1 parent 2185294 commit 1797595
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-theme-classic/src/theme/DocPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down

0 comments on commit 1797595

Please sign in to comment.