Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React: How to add Textfield in Selects using Material-ui?

How I add Textfield in Selects(Select Menu) using Material-UI ?

I try to search it, but I did not earn much.

How can I do?

I tried it out, but there was a problem with the css.

like image 884
ko_ma Avatar asked Sep 02 '25 08:09

ko_ma


1 Answers

Since the other answer doesn't really answer the question, I figured I'd share my insights.

I'm basically trying to create something similar to what you see in Google Calendar's time inputs, where you get a list of pre-defined times at convenient 30 min intervals, but you can also type in a custom time:

GCal time picker

Unfortunately, scouring through the Material UI docs and GitHub issues, I don't believe there's anything built-in to accomplish this. You will have to have separate <TextField/> and <Menu/> components, and link them together manually. Have the <Menu/> anchored below the <TextField/>, and any time it changes, have it update the <TextField/>, which will serve as the main state.

like image 54
V. Rubinetti Avatar answered Sep 04 '25 23:09

V. Rubinetti