-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Summary 💡
There was talk about a similar idea in mui/material-ui#24511 (comment) which pertained to the DatePicker. It would be nice to see this functionality in the the Pro Plan's DateRangePicker. I understand there is the disablePointerEvents prop which allows focus to shift; however, for accessibility purposes I believe that having the calendar pop up after clicking the calendar icon, like with the case of the DatePicker component, would be nice.
Examples 🌈
No response
Motivation 🔦
I was able to get close to the functionality by using the renderInput
prop alongside two TextFields, each with InputProps
and then the following:
InputProps={{
endAdornment: (
<InputAdornment position='end'>
<IconButton onClick={customFunctionThatOpensTheDateRangePicker} edge='end'>
<DateRangeIcon />
</IconButton>
</InputAdornment>
),
}}
It was pretty effective. I had to add a ClickAwayListener to address some things; however, I was fine. Then, I discovered that the mobile view buttons for "cancel" and "ok" were not responsive because I had overwritten the open
prop on the DateRangePicker and thus (at least according to my current understanding) would have to account for all the other changes of state myself. That's when I realized how nice it would be for this to just be built in. I'm sure it comes with some unique challenges; however, if you can't see a concise workaround for me or if you feel it's worth it, I would be very appreciative.