-
Notifications
You must be signed in to change notification settings - Fork 51
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
How to make the field nullable or remove the selected date? #59
Comments
you probably need a clear button #9 which |
This was also an annoyance for me, but I worked around it by managing the state separately. I wish the individual inputs were easier to manage. |
@robcrockhlx @fruitbang // your code here that would do something to the value and what's the expectation
<Datepicker value={value}/> but the single |
@aboveyunhai thank you for being open to the improvement. Here's a screenshot if how I added an icon button to clear the input when the formState[dateName] property is not undefined. And here's where I hackily add a formKey that's just new Date.now() to force a rerender of the form so that the date inputs display to updated values. I think the issue and coupling we're hoping for is to work well with the Controller component from react-hook-forms https://react-hook-form.com/docs/usecontroller/controller |
I am using
SingleDatepicker
and am trying to allow the field value to be removed in the event someone selected a date but then realizes they do not want one (it is an optional field for my form). I am using it with react-hook-form as well. Is this possible?The text was updated successfully, but these errors were encountered: