Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Select] slotProps overrides entire default props #38700

Closed
2 tasks done
giladv opened this issue Aug 29, 2023 · 3 comments · Fixed by #38703
Closed
2 tasks done

[Select] slotProps overrides entire default props #38700

giladv opened this issue Aug 29, 2023 · 3 comments · Fixed by #38703
Assignees
Labels
bug 🐛 Something doesn't work component: select This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material

Comments

@giladv
Copy link

giladv commented Aug 29, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

<Select MenuProps={{ slotProps: { paper: {} } }}>
   ...
</Select>

Current behavior 😯

dropdown menu width will be the smallest menu item width instead of the Select width.

Expected behavior 🤔

dropdown menu width should be the Select width.

Context 🔦

on a side note, this whole slotsProps, componentProps and then MenuProps(with an uppercase) and other methods are all different depending on the component which is not ideal.
Also, all props overrides should be implemented as a deep merge of objects of this sort of bugs will pop all the time.

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@giladv giladv added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 29, 2023
@giladv
Copy link
Author

giladv commented Aug 29, 2023

And a workaround for anyone else effected by this:
use this instead

MenuProps={{ PaperProps: { elevation: 1 } }}

@zannager zannager added the component: select This is the name of the generic UI component, not the React module! label Aug 29, 2023
@michaldudak michaldudak added bug 🐛 Something doesn't work package: material-ui Specific to @mui/material and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 29, 2023
@michaldudak
Copy link
Member

Thanks for reporting this issue. I've already submitted a fix.

As for API inconsistencies - we are in a transition period where some of the components use the new slotProps API, while others haven't been modified and still have the old MenuProps-style API.
We're working towards unifying it. CC @DiegoAndai

@giladv
Copy link
Author

giladv commented Aug 29, 2023

thanks for the quick action!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: select This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants