Skip to content

Commit

Permalink
fix(UIShell): expand check so side nav items close properly (#9976)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
dakahn and kodiakhq[bot] authored Oct 29, 2021
1 parent a1c3b6f commit 9f3da13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react/src/components/UIShell/SideNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ const SideNav = React.forwardRef(function SideNav(props, ref) {
: expanded;
// avoid spreading `isSideNavExpanded` to non-Carbon UI Shell children
return React.cloneElement(child, {
...(CARBON_SIDENAV_ITEMS.includes(child.type?.displayName)
...(CARBON_SIDENAV_ITEMS.includes(
child.type?.displayName ?? child.type?.name
)
? {
isSideNavExpanded: currentExpansionState,
}
Expand Down

0 comments on commit 9f3da13

Please sign in to comment.