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

[RFC] Remove allowSameDateSelection prop #4728

Closed
flaviendelangle opened this issue May 2, 2022 · 1 comment
Closed

[RFC] Remove allowSameDateSelection prop #4728

flaviendelangle opened this issue May 2, 2022 · 1 comment
Assignees
Labels
component: pickers This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer discussion dx Related to developers' experience RFC Request For Comments

Comments

@flaviendelangle
Copy link
Member

flaviendelangle commented May 2, 2022

Current behavior

We have a allowSameDateSelection publicly exposed which decided if clicking on the already-selected day should count as a change or not (meaning should it switch to the next view / close the picker).
By default, it is false except for DateTimePicker otherwise you can change only the time.

But on #4456 we see that we have the exact same problem on DatePicker

Proposal

Remove allowSameDateSelection altogether
Now that we merged #4408, we don't call onChange when the new value is equal to the old one.

The only scenario where this prop has an interest is in DateRangePicker if we want to prevent selecting a single day range
But as Sebastian pointed out in mui/material-ui#23701 (comment), this prop is not great for this use case either. I propose to introduce a new prop isRangeAvailable?: (start: TDate, end: TDate) => boolean that we could call on both click and hover to visually show that the range the user is aiming for will not pass validation.

Relates issues

@flaviendelangle flaviendelangle added the component: pickers This is the name of the generic UI component, not the React module! label May 2, 2022
@flaviendelangle flaviendelangle self-assigned this May 2, 2022
@joserodolfofreitas joserodolfofreitas added dx Related to developers' experience ux labels May 2, 2022
@flaviendelangle
Copy link
Member Author

Fixed by #4808

@oliviertassinari oliviertassinari added the RFC Request For Comments label Aug 12, 2022
@oliviertassinari oliviertassinari added design This is about UI or UX design, please involve a designer and removed design: ux labels Aug 18, 2023
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! design This is about UI or UX design, please involve a designer discussion dx Related to developers' experience RFC Request For Comments
Projects
None yet
Development

No branches or pull requests

3 participants