-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
DateInput defaultDate
prop does not work when value={null}
#4426
Comments
defaultDate
prop does not work when value={null}
I'd like to take a stab at this if no one else is already working on it. |
@rtivital For @tofu2323 Why do you need @AdamGEmerson Feel free to do so. :) I just had a quick look into the code but had difficulties understanding the meaning of the various props (see my question to rtivital). |
Also the docs say that |
As @cyantree stated, the most likely issue is that these props are meant for uncontrolled input and I also noticed playing with the example sandbox that the See this example: One thing that might be worth addressing here is why the |
@tofu2323 In my approach, I directly set the default date I need either in the value prop of the DateInput component or in the initialValues object when using useForm. This avoids setting the value to null first and then assigning the default date separately, which seems more straightforward and logical to me:
|
Fixed in 7.14.1 |
What package has an issue
@mantine/dates
Describe the bug
The defaultDate prop does not work on DateInput with useForm
What version of @mantine/hooks page do you have in package.json?
6.0.13
If possible, please include a link to a codesandbox with the reproduced problem
https://codesandbox.io/s/objective-lichterman-4qy3ml?file=/src/App.tsx
Do you know how to fix the issue
No
Are you willing to participate in fixing this issue and create a pull request with the fix
None
Possible fix
No response
The text was updated successfully, but these errors were encountered: