[material-ui][Select] alternative option for select multiple behavior, that item click replaces existing selection instead of adding it #43813
Labels
component: select
This is the name of the generic UI component, not the React module!
new feature
New feature or request
package: material-ui
Specific to @mui/material
Milestone
Summary
Currently, an item click in
<Select multiple />
is handled as toggling:On the other hand, HTML native
<select multiple />
behaves like this:I want a material multi-select component except that it should behave like native multi-select, since my component expects multi-select sometimes but not very frequently. Range select(Shift+Click) is not needed. Does current MUI provide such option? If it does not, then I would like to suggest to add it.
Examples
I skimmed the code and apparently this is the section in charge for current behavior.
https://github.com/sai6855/material-ui/blob/master/packages/mui-material/src/Select/SelectInput.js#L269
If we should add the implementation, probably adding a new boolean
nativeLike
prop and fixing the logic like below would help..?I haven't tested if this works. I will make some PR if it seems like a good idea.
Motivation
It would be nice to have an another option for multiple select which behave more similarly to HTML native multiple select.
Search keywords: select multiple behavior
The text was updated successfully, but these errors were encountered: