Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formik sets touched to true for all fields during a submit attempt

I've got an issue where trying to submit this form brings up a warning as every field is being marked as formik.touched=true - this warning should only come up when name field's are changed.

I've tried removing/adding onBlur (some online forums said that could be causing an issue), and otherwise tried console logging everywhere. Can't find out why touched is always true!

like image 300
Billies Wesley Avatar asked Oct 28 '25 06:10

Billies Wesley


1 Answers

Formik always sets touched to true on submission.

https://formik.org/docs/guides/form-submission

Without seeing your validation schema, and errors, you might need to add a .nullable() check on your values you are passing through.

like image 153
TR3 Avatar answered Oct 31 '25 11:10

TR3