Closed apollux closed 4 years ago
Same issue there
@apollux it looks like this version of @material-ui/pickers@3.2.5 (https://github.com/mui-org/material-ui-pickers/releases/tag/v3.2.5) is breaking the validation. Using 3.2.4 solves the problem.
Yes I tested this with:
@material-ui/pickers:3.2.10
@formik-material-ui-picker:0.0.4
@formik-material-ui:2.0.0-alpha.3
@formik:2.1.4
I forked your codesandbox with the 0.0.6 release of formik-material-ui-picker and reproduced it there as well: https://codesandbox.io/s/stupefied-germain-elclg
Fixed in 0.0.8 - https://codesandbox.io/s/stupefied-germain-elclg
Awesome! Thank you :)
The initial values are set to empty strings, but somehow the fields supply the current time. The pickers are based on the codesandbox date picker and time picker.
time and date pickers default to current timestamp even if initialValues are set to empty strings
The initial values are set to empty strings, but somehow the fields supply the current time. The pickers are based on the codesandbox date picker and time picker.
This was not the problem. I needed to set the value of the date picker and time picker fields to null
in the initial values.
https://github.com/stackworx/formik-material-ui/issues/147#issuecomment-785355948
Including the TimePicker, DatePicker or DateTimePicker in a form makes Formik consider the form as invalid. The errors property for the picker is set to an empty string and apparently that makes the form invalid.
Consider the following example:
this will show errors to be:
and the
isValid
field to befalse
. https://codesandbox.io/s/sad-moore-i4b4k