Skip to content

Commit

Permalink
remove deprecated prop usage
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Jan 2, 2025
1 parent 15c015b commit 9e82abd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
7 changes: 6 additions & 1 deletion packages/mui-material/src/Menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ const Menu = React.forwardRef(function Menu(inProps, ref) {
}
});

const externalForwardedProps = {
slots,
slotProps: { ...slotProps, list: slotProps.list || MenuListProps },
};

const PaperSlot = slots.paper ?? MenuPaper;
const paperExternalSlotProps = slotProps.paper ?? PaperProps;

Expand All @@ -185,7 +190,7 @@ const Menu = React.forwardRef(function Menu(inProps, ref) {

const [ListSlot, listSlotProps] = useSlot('list', {
elementType: MenuMenuList,
externalForwardedProps: { slots, slotProps },
externalForwardedProps,
ownerState,
className: clsx(classes.list, MenuListProps.className),
});
Expand Down
16 changes: 8 additions & 8 deletions packages/mui-material/src/Select/SelectInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,16 +556,16 @@ const SelectInput = React.forwardRef(function SelectInput(props, ref) {
horizontal: 'center',
}}
{...MenuProps}
MenuListProps={{
'aria-labelledby': labelId,
role: 'listbox',
'aria-multiselectable': multiple ? 'true' : undefined,
disableListWrap: true,
id: listboxId,
...MenuProps.MenuListProps,
}}
slotProps={{
...MenuProps.slotProps,
list: {
'aria-labelledby': labelId,
role: 'listbox',
'aria-multiselectable': multiple ? 'true' : undefined,
disableListWrap: true,
id: listboxId,
...MenuProps.MenuListProps,
},
paper: {
...paperProps,
style: {
Expand Down

0 comments on commit 9e82abd

Please sign in to comment.