Skip to content

Commit

Permalink
fix(UIShell): expand check so side nav items close properly (carbon-d…
Browse files Browse the repository at this point in the history
…esign-system#9976)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and tay1orjones committed Nov 4, 2021
1 parent 0dcc922 commit f0308ee
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 f0308ee

Please sign in to comment.