Bug
I have a form with fields email and password and a submit button. Both fields are added as <Field> with a validate property.
If I submit the form without focusing any of the fields, the functions in validate are never run and I don't see an error message.
I have to focus one of the fields to see an error message.
Please see https://codesandbox.io/s/107rvl2vxj
The functions in validate should run before form submission.
If you add a valid check in your button I think you'll get the desired behavior.
(Also, you have to add isValid in your used props)
<button type="submit" disabled={isSubmitting || !isValid}>
Submit
</button>
Thank you for your comment. Disabling the submit button only hides the problem, it doesn't fix it.
Have a fix for this as well that will work for this and for fast field.
@jaredpalmer I'm seeing this as well. Digging into the code, I just noticed this kind of separate issue... the !! comparisons are not the same, is that correct? https://github.com/jaredpalmer/formik/blob/master/src/Field.tsx#L117 !== https://github.com/jaredpalmer/formik/blob/master/src/Field.tsx#L125
is there any updates on this?
Thanks
Deployed in latest beta. Let me know how it goes. I'm surprised more ppl didn't speak up about this sooner
Most helpful comment
Deployed in latest beta. Let me know how it goes. I'm surprised more ppl didn't speak up about this sooner