Skip to content

Commit

Permalink
fix(ui): fix expandedByDefault in MenuItem
Browse files Browse the repository at this point in the history
  • Loading branch information
matej21 committed Sep 29, 2023
1 parent 856b76e commit 6b1b16c
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 6b1b16c

Please sign in to comment.