I am trying to enhance my date picker functionality by displaying it when users click anywhere within the field, not just on the calendar icon.
Below is the picker:
https://i.stack.imgur.com/mrAui.png
export function DatePickerField(props) {
......
return (
<Grid container>
<MuiPickersUtilsProvider utils={DateFnsUtils}>
<KeyboardDatePicker
{...field}
{...props}
disableToolbar
inputVariant="outlined"
value={selectedDate}
onChange={_onChange}
error={isError}
autoOk
invalidDateMessage={isError && error}
helperText={isError && error}
/>
</MuiPickersUtilsProvider>
</Grid>
);
}
The reason I need this enhancement is that although no errors are thrown when a date is manually entered, I get an invalid date
in the form data.
Any suggestions on how I can successfully display the picker when the field is clicked?