-
Notifications
You must be signed in to change notification settings - Fork 68
DatePicker setting date to null #42
Comments
@alexkuz do you see any particular solution for that, if so let's discuss, I'll submit a PR. We need that functionality anyways. |
I guess it should be like that:
Also, we should probably externalize |
@alexkuz Thanks for a feedback, will take a look.. |
hey @alexkuz .. I tried to apply the solution you proposed above, but seriously failed with it. If I'm able to make one part work, I broke another and otherwise. So, I went another direction. Examined As for removing value completely (from input field), I did a workaround. I listen to The PR is here, |
I have a form where
DatePicker
is used, I can set some particular field with a date value and save the form. After, I want to delete the date to make itnull
. As I remove value completely, two things happen.moment.js
writes a warning to console,1. `onChange` handler of field is _not_ triggered. 2. If I reload the form, I can see the date is still there (so, a null field is not submitted to a server).
From code, I see that once a value is removed from the input field,
getStateFromProps()
will receive an empty string and construct default moment object.I believe this behavior is wrong and prevents to set fields to
null
.The text was updated successfully, but these errors were encountered: