-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
[material-next][Select] Refactor to use Base UI's hooks #40210
Conversation
Netlify deploy previewhttps://deploy-preview-40210--material-ui.netlify.app/ @mui/material-next: parsed: +0.40% , gzip: +0.64% Bundle size reportDetails of bundle changes (Toolpad) |
ce9a10a
to
d5546b0
Compare
fd56820
to
c1f92b4
Compare
c1f92b4
to
d1327d7
Compare
|
||
The menu dependency was removed, and the `MenuProps` prop was removed with it. | ||
|
||
(Section WIP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to create a follow-up issue for this one as it will depend on the changes for the Material You design, which we're not doing right now.
Given Base UI's decision to adopt the Composition API and Material UI to be built on top of that API instead of hooks, I'll close this PR. We can use it as a guide for implementing Material UI's Select on top of Base UI's Composition API. This will reduce the friction for Base UI's Composition API refactor. |
Summary
Refactor the
SelectInput
component based on Base UI'suseSelect
hook. This also implies adding theOption
component, which consumes theuseOption
hook.Experiment
https://deploy-preview-40210--material-ui.netlify.app/experiments/material-next/select/
Issues solved with this refactor
Select
component to render additional elements in dropdown #34516Breaking changes
MenuItem
replaced withOption
. Users can just copy-pasteOption
wherever they hadMenuItem
, as it supports the same API exceptselected
, which is ignored whenMenuItem
is insideSelect
anyways.MenuProps
was removed. We should be able to support most of the functionality either via thePopoverProps
prop (added in this PR) or newSelect
props (not yet added)