Skip to content
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

[question] DateRangePicker readonly only for one of the two fields #12056

Closed
david-ic3 opened this issue Feb 14, 2024 · 4 comments
Closed

[question] DateRangePicker readonly only for one of the two fields #12056

david-ic3 opened this issue Feb 14, 2024 · 4 comments
Assignees
Labels
component: pickers This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ support: question Community support but can be turned into an improvement

Comments

@david-ic3
Copy link

david-ic3 commented Feb 14, 2024

The problem in depth

There is an option to have a range date picker in a readonly mode : https://mui.com/x/react-date-pickers/date-range-picker/ . This set both start and end date in a readonly mode.

What is the best way to set the readonly mode to only the 'end' date ?

Your environment

No response

Search keywords: DateRangePicker readonly
Order ID: #19458

@david-ic3 david-ic3 added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Feb 14, 2024
@zannager zannager added support: question Community support but can be turned into an improvement component: pickers This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Feb 14, 2024
@LukasTy LukasTy self-assigned this Feb 15, 2024
@LukasTy
Copy link
Member

LukasTy commented Feb 15, 2024

Hello @david-ic3
I've explored possible solutions and I do not see an easy way to do it, without overriding a bit too much code. 🙈

Could you provide more information about your use case?
Why do you need only the end date in "readonly" mode?
At first sight, it would seem like a bit of a strange UX behavior.

Maybe having the bigger picture about you need to achieve, we'd be able to come up with a different solution for it. 🤞 🤔

@LukasTy LukasTy added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 15, 2024
@david-ic3
Copy link
Author

@LukasTy , there is goes :

It's for the end users to select a range of dates with a fixed en date. The end date is decided by the data used.

We still want to have the nice look of the Range Calendar without the possibility to change the end date.

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Feb 15, 2024
@LukasTy
Copy link
Member

LukasTy commented Feb 15, 2024

@david-ic3 Thank you for confirming your use case. 👍
What do you think about going for a custom field implementation, where you would not pass the event listeners to the end field to avoid having the option of adjusting the value through that input?
Could such a solution be enough to cover your use case?
P.S. You could also couple it with controlling the rangePosition to enhance your desired behavior.

@LukasTy LukasTy added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 15, 2024
Copy link

The issue has been inactive for 7 days and has been automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

3 participants