Select component with ability to write custom value

Viewed 1599

Hi is there any option that Material UI Select component can accept custom string? To not force user to pick only existing value?

3 Answers

No, Select component dont provide such functionality. For the same purpose I used the combination of two components: TextField for custom string input and IconMenu for select from the predefined values and set it to the input field.

And it looks almost the same:

enter image description here

I see this is an old post, but if anybody is looking for simpler solution you can use this component with "freeSolo" prop:

The textbox may contain any arbitrary value, but it is advantageous to suggest possible values to the user, e.g., a search field may suggest similar or previous searches to save the user time

That is exactly what you need.

Related