mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-31 23:40:39 +02:00
fix(theme): fix unability to navigate to category's page when browsing its children items (#11242)
This commit is contained in:
parent
d3ab0e63a0
commit
60df4936aa
1 changed files with 5 additions and 1 deletions
|
@ -188,7 +188,11 @@ export default function DocSidebarItemCategory({
|
|||
? (e) => {
|
||||
onItemClick?.(item);
|
||||
if (href) {
|
||||
if (isActive) {
|
||||
// When already on the category's page, we collapse it
|
||||
// We don't use "isActive" because it would collapse the
|
||||
// category even when we browse a children element
|
||||
// See https://github.com/facebook/docusaurus/issues/11213
|
||||
if (isCurrentPage) {
|
||||
e.preventDefault();
|
||||
updateCollapsed();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue