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

[@mantine/dates] Fix: minimum-date is not in current month and value is not provided #5786

Closed
wants to merge 1 commit into from

Conversation

msv96
Copy link
Contributor

@msv96 msv96 commented Feb 18, 2024

Fixes #5695.

This PR solves:

  • When the value is null and minDate is in past or future, then this fix will take minDate as default and show the calendar.

@msv96
Copy link
Contributor Author

msv96 commented Feb 18, 2024

Hi @rtivital, If this approach is good, then I will be checking for other date inputs and update those as well. Else, whatever the aproach is suggested, I will follow the same for every date inputs.

@@ -167,7 +167,7 @@ export const DateInput = factory<DateInputFactory>((_props, ref) => {

useEffect(() => {
if (controlled) {
setDate(value!);
setDate(value ? value! : minDate!);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When clearable: true and you remove a selected value, visually it's removed from the UI however _date still gets set to the minDate instead of null.

@rtivital
Copy link
Member

Thanks for showing interest in contributing to Mantine! Unfortunately, this pull request cannot be accepted because of one of the following reasons:

  • The proposed change has not been discussed with the maintainer – it does not fit the library in some way
  • The proposed change is not wanted in the library or implemented incorrectly
  • The PR is outdated or has errors in tests

@rtivital rtivital closed this Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The minDate in Dates should be the default date, when date is not given
3 participants