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

[pickers] Ability to deselect current date if value is null #9119

Open
2 tasks done
AlexKrupko opened this issue May 25, 2023 · 5 comments
Open
2 tasks done

[pickers] Ability to deselect current date if value is null #9119

AlexKrupko opened this issue May 25, 2023 · 5 comments
Labels
component: pickers This is the name of the generic UI component, not the React module!

Comments

@AlexKrupko
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

No response

Current behavior 😯

Is it possible to disable selecting of current date in the controlled DatePicker v6 if value is null?
Screen Shot 2023-05-26 at 02 49 22

I've tried to set defaultCalendarMonth with new Date(0), but unfortunately it changes just date in the title and doesn't affect on the picker.
Screen Shot 2023-05-26 at 02 51 51

I noticed several other related issues with default selected date, but all of them ask to change this date. In my case, I don't need to select anything until the user selects something.

Thanks

Expected behavior 🤔

No response

Context 🔦

No response

Your environment 🌎

No response

Order ID or Support key 💳 (optional)

No response

@AlexKrupko AlexKrupko added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 25, 2023
@LukasTy
Copy link
Member

LukasTy commented May 26, 2023

Could you please elaborate on what would be your desired result?
Do I understand you correctly, that you'd want the calendar picker header to be empty until some value is selected? 🤔
241083775-d48db4fb-1e70-43fa-a63d-854e4f3d1eb7
In which case it looks like this would be a duplicate of #6653 which already has a pending PR, which needs a bit more priority. 🙈

@LukasTy LukasTy added status: waiting for author Issue with insufficient information component: pickers This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 26, 2023
@flaviendelangle
Copy link
Member

From what I understand, the issue here is that May is selected
In which case, you are looking for the disableHighlightToday prop
See this demo

But if it's the header, I have to restart the work, I'm just waiting for the design rework to be merged 👍

@AlexKrupko
Copy link
Author

Hi @flaviendelangle and @LukasTy ,
Actually, I need both of your mentions.
I need to deselect current month and disableHighlightToday prop really helps with this, but May is still focused.
And also I need to have an empty header if no date is selected. Or even better to have ability to specify a custom text in that case.

Screen Shot 2023-05-27 at 01 24 26

@github-actions github-actions bot removed the status: waiting for author Issue with insufficient information label May 26, 2023
@AlexKrupko AlexKrupko changed the title [pickers] Ability to don't select current date if value is null [pickers] Ability to deselect current date if value is null May 26, 2023
@LukasTy
Copy link
Member

LukasTy commented May 29, 2023

I need to deselect current month and disableHighlightToday prop really helps with this, but May is still focused.

Improvements to defaultCalendarMonth and the ability to provide a referenceValue, which would be used by pickers when no value is present is in the works (the fields components will already support it in the next release).
Once referenceValue is supported, your use case should be handled in regards to not focusing the current month, but Jan would be focused (the first month).

And also I need to have an empty header if no date is selected. Or even better to have ability to specify a custom text in that case.

Overriding the header will be supported once #7784 is released. Feel free to follow the mentioned PR or referenced issue to be notified when the feature will be available.

@flaviendelangle Do you think we should keep this issue open until both features are released and we double-check if all the OP requirements are supported? 🤔

@flaviendelangle
Copy link
Member

Fine for me 👍

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!
Projects
None yet
Development

No branches or pull requests

3 participants