I have TextField. In that the Material UI has Alarm Clock icon.
The material UI docs have like this:
<form className={classes.container} noValidate>
<TextField
id="time"
label="Alarm clock"
type="time"
defaultValue="07:30"
className={classes.textField}
InputLabelProps={{
shrink: true,
}}
inputProps={{
step: 300, // 5 min
}}
/>
</form>
What I have designed is like this:
<TextField
id="time"
type="time"
style={{
width: "148px",
marginLeft: 4,
marginRight: 6,
padding: "2px 0px 3px 6px",
}}
defaultValue="03:30"
value={timeChange}
onChange={handleTimeChange}
className={classes.textField}
color="secondary"
InputProps={{
disableUnderline: true,
endAdornment: <ExpandMoreIcon style={{ color: "gray" }} />,
classes: {
input: classes.floatingLabelFocusStyle,
},
// className: classes.input,
}}
/>;
And added some CSS to it:
input[type="time"]::-webkit-calendar-picker-indicator {
background: none;
}
Which I'm getting:
Is there a way, that I can make ExpandMoreIcon behave like the alarm clock on click and open the pop up to show time picker?
I don't want to show the alarm clock icon. I just want the functionality of alarm clock in ExpandMoreIcon icon?
Is there any fix to it?.
Thank you.
