-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DateRangePicker] Using SingleInputDateRangeField with readOnly=true causes unexpected UX #12576
Comments
Hey @TimESQuit your Codesandbox is unavailable. You might have to make it public. |
@michelengelen |
@TimESQuit The problem has been identified and a possible fix PR raised. P.S. If you would try adding an |
How did we do @TimESQuit? |
I can't fully tell, but does the code fix just apply to v7? We recently migrated to v6 and are not looking to migrate to v7 right away so would really need this change in v6 as well. Thanks! |
It has been fixed only on v7 for now. |
@TimESQuit Would it be fine if we released this fix on v6 in around a week (~next Thursday)? |
Around next Thursday works. Thanks! |
Steps to reproduce
Minimal example of
DateRangePicker
usingSingleInputDateRangeField
andreadOnly: true
:https://codesandbox.io/p/devbox/loving-tree-lphyk2?file=%2Fsrc%2FDemo.tsx
Steps:
Current behavior
Using
DateRangePicker
withSingleInputDateRangeField
andreadOnly: true
forces the the first date selected to be the end date of the range, with no apparent way to easily override/modify this behavior. Note: this only seems to happen withreadOnly: true
.Expected behavior
Using
DateRangePicker
withSingleInputDateRangeField
andreadOnly: true
behaves the same as whenreadOnly: false
and selects the start date first.Context
Using
@mui/x-date-pickers-pro@^5
, we used theDateRangePicker
withrenderInput
to create a single element to display both start and end dates. For our UX, we found it more trouble to allow a user to edit the field directly (not from the UI calendar popups), so disabled the field. With the move toSingleInputDateRangeField
and removal ofrenderInput
in v6 and v7, there doesn't seem to be a great way to replicate a single basic read-only field withDateRangePicker
.Your environment
npx @mui/envinfo
Search keywords: readOnly single input SingleInputDateRangeField DateRangePicker
Order ID: 85560
The text was updated successfully, but these errors were encountered: