Skip to content

Commit

Permalink
fix Menu
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjORbj committed Apr 9, 2023
1 parent 3ef842c commit 158c924
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/mui-joy/src/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const Menu = React.forwardRef(function Menu(inProps, ref: React.ForwardedRef<HTM
const rootProps = useSlotProps({
elementType: MenuRoot,
getSlotProps: getListboxProps,
externalForwardedProps: other,
externalForwardedProps,
externalSlotProps: {},
ownerState: ownerState as MenuOwnerState & ListOwnerState,
additionalProps: {
Expand All @@ -147,11 +147,7 @@ const Menu = React.forwardRef(function Menu(inProps, ref: React.ForwardedRef<HTM
open,
disablePortal,
keepMounted,
as: PopperUnstyled,
modifiers,
slots: {
root: component || 'ul',
},
},
className: classes.root,
});
Expand All @@ -165,7 +161,15 @@ const Menu = React.forwardRef(function Menu(inProps, ref: React.ForwardedRef<HTM
);

const result = (
<MenuRoot {...rootProps}>
<MenuRoot
{...rootProps}
{...(!props.slots?.root && {
as: PopperUnstyled,
slots: {
root: component || 'ul',
},
})}
>
<MenuUnstyledContext.Provider value={menuContextValue}>
<ListProvider nested>
{disablePortal ? (
Expand Down

0 comments on commit 158c924

Please sign in to comment.