Skip to content

Commit

Permalink
fix check for nested active
Browse files Browse the repository at this point in the history
  • Loading branch information
winkerVSbecks committed Aug 30, 2024
1 parent 5734372 commit d91cfa6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Navigation/CollapsibleGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ function checkIfSomeActive(group: TransformedNavGroup, url: string): boolean {
if (isNestedTransformedGroup(item)) {
return item.items.some((nestedItem) => {
if (isNestedTransformedGroup(nestedItem)) {
return checkIfSomeActive(group, url);
return checkIfSomeActive(nestedItem, url);
} else {
isUrlActive(nestedItem.slug, url);
return isUrlActive(nestedItem.slug, url);
}
});
} else {
Expand All @@ -149,6 +149,7 @@ export const CollapsibleGroup = ({
url: string;
isHome?: boolean;
nested?: boolean;
open?: boolean;
}) => {
const isSomeActive = checkIfSomeActive(group, url);

Expand Down

0 comments on commit d91cfa6

Please sign in to comment.