diff --git a/templates/modern/src/nav.ts b/templates/modern/src/nav.ts index 9660b0a5534..7ff75dcce26 100644 --- a/templates/modern/src/nav.ts +++ b/templates/modern/src/nav.ts @@ -142,7 +142,9 @@ function findActiveItem(items: (NavItem | NavItemContainer)[]): NavItem { continue } const prefix = commonUrlPrefix(url, item.href) - if (prefix > maxPrefix) { + if (prefix === maxPrefix) { + activeItem = undefined + } else if (prefix > maxPrefix) { maxPrefix = prefix activeItem = item }