Skip to content

Commit

Permalink
Merge pull request #633 from contember/fix/menu-collapse
Browse files Browse the repository at this point in the history
fix(ui): fix expandedByDefault in MenuItem
  • Loading branch information
matej21 authored Oct 19, 2023
2 parents 856b76e + 6b1b16c commit c908a52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ui/src/components/Menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function MenuItem<T = unknown>({ children, componentClassName = 'menu-ite
const menuId = useMenuId()
const [expanded, setExpanded] = useSessionStorageState<boolean>(
`menu-${menuId}-${menuItemId}`,
val => val ?? (props.expandedByDefault || depth === 0 || !label),
val => val ?? props.expandedByDefault ?? (depth === 0 || !label),
)

const className = useClassNameFactory(componentClassName)
Expand Down

0 comments on commit c908a52

Please sign in to comment.