From 498bd936c793b4a18cbaea5587e6a0a9e723dc5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dudak?= Date: Wed, 30 Aug 2023 09:04:13 +0200 Subject: [PATCH] [Select][material-ui] Merge slotProps.paper with internal Paper props (#38703) --- .../mui-material/src/Select/Select.test.js | 18 ++++++++++++++++++ .../mui-material/src/Select/SelectInput.js | 17 ++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/packages/mui-material/src/Select/Select.test.js b/packages/mui-material/src/Select/Select.test.js index 6b8aa8a23bfd6a..0ee8903cc2cd83 100644 --- a/packages/mui-material/src/Select/Select.test.js +++ b/packages/mui-material/src/Select/Select.test.js @@ -835,6 +835,24 @@ describe(' + Ten + , + ); + + const paper = getByTestId('paper'); + const selectButton = getByRole('button', { hidden: true }); + + expect(paper.style).to.have.property('minWidth', `${selectButton.clientWidth}px`); + }); }); describe('prop: SelectDisplayProps', () => { diff --git a/packages/mui-material/src/Select/SelectInput.js b/packages/mui-material/src/Select/SelectInput.js index ba51fc1925035a..72452dc1d88857 100644 --- a/packages/mui-material/src/Select/SelectInput.js +++ b/packages/mui-material/src/Select/SelectInput.js @@ -482,6 +482,11 @@ const SelectInput = React.forwardRef(function SelectInput(props, ref) { const classes = useUtilityClasses(ownerState); + const paperProps = { + ...MenuProps.PaperProps, + ...MenuProps.slotProps?.paper, + }; + return (