diff --git a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php index 1a050fef99c..a4bfb4fe3c6 100644 --- a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php +++ b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php @@ -108,11 +108,15 @@ private function shouldIndexPageBeActive(string $group, HydePage $currentPage): { // Unless the index page has a specific group set, the first group in the sidebar should be open when visiting the index page. + if ($this->groupMatchesCurrentPageGroup($currentPage, $group)) { + return true; + } + if (filled($currentPage->navigationMenuGroup())) { return false; } - return ($group === $this->getItems()->firstOrFail()->getGroupKey()) || $this->groupMatchesCurrentPageGroup($currentPage, $group); + return $group === $this->getItems()->firstOrFail()->getGroupKey(); } protected function groupMatchesCurrentPageGroup(HydePage $currentPage, string $group): bool