TanStackT
TanStackβ€’6mo agoβ€’
23 replies
popular-magenta

possible onMount & onChange validation errors bug

I am trying to use onMount and onChange validators with my Zod schema in order to, well, "always" validate the form inputs. I was playing with the official Form and Field validation example in Stackblitz and I ended up in a weeird behaviour: The error messages of the non-edited field are duplicated. I guess this is a bug, right? The picture shows the initial state of the form, which is correct. As soon as you edit one field, e.g. the first one, the second field shows its error message twice! Same issue occurs if you edit the second field first: the first field shows its two error messages twice πŸ˜΅β€πŸ’«

Link to stackblitz reproducible example
https://stackblitz.com/edit/tanstack-form-pobqx3yj?file=src%2Findex.tsx
image.png
image.png
Was this page helpful?