Skip to content

Commit

Permalink
fix: make proper highlighting doc link if no sidebar (#5317)
Browse files Browse the repository at this point in the history
* fix: All navbar items without sidebar are active

Close All navbar items without sidebar are active #5310

* Update packages/docusaurus-theme-classic/src/theme/NavbarItem/DocNavbarItem.tsx

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
  • Loading branch information
hamzahamidi and lex111 authored Aug 10, 2021
1 parent 6059955 commit 39faf44
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function DocNavbarItem({
{...props}
className={clsx(props.className, {
[activeDocInfimaClassName]:
activeDoc && activeDoc.sidebar === doc.sidebar,
activeDoc?.sidebar && activeDoc.sidebar === doc.sidebar,
})}
activeClassName={activeDocInfimaClassName}
label={staticLabel ?? doc.id}
Expand Down

0 comments on commit 39faf44

Please sign in to comment.