Skip to content

Commit f0308ee

Browse files
dakahnkodiakhq[bot]
authored andcommitted
fix(UIShell): expand check so side nav items close properly (#9976)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 0dcc922 commit f0308ee

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/react/src/components/UIShell/SideNav.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ const SideNav = React.forwardRef(function SideNav(props, ref) {
9090
: expanded;
9191
// avoid spreading `isSideNavExpanded` to non-Carbon UI Shell children
9292
return React.cloneElement(child, {
93-
...(CARBON_SIDENAV_ITEMS.includes(child.type?.displayName)
93+
...(CARBON_SIDENAV_ITEMS.includes(
94+
child.type?.displayName ?? child.type?.name
95+
)
9496
? {
9597
isSideNavExpanded: currentExpansionState,
9698
}

0 commit comments

Comments
 (0)