Skip to content

Commit

Permalink
set subnav contains current item to false
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanskrogh committed Jul 7, 2024
1 parent 219868e commit 8ef5067
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react/src/NavList/NavList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ function ItemWithSubNav({children, subNav, depth, defaultOpen, sx: sxProp = defa
if (currentItem) {
setContainsCurrentItem(true)
setIsOpen(true)
} else {
// If the SubNav doesn't contain the current item, set it to false
setContainsCurrentItem(false)
}
}
}, [subNav, buttonId])
Expand Down

0 comments on commit 8ef5067

Please sign in to comment.