-
-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validateAllFields isn't working with touched fields #521
Comments
I see the reason is HERE only "untouched" fields are validated. Is this behaviour intended? How can I also validate touched fields? |
I want to validate all fields at once when people clicked a button too |
i need to manual validate fields at submit. |
Hey y'all - I'm investigating this now. However @fallenleavesguy @chaozwn, I will note that I think y'all aren't facing the same issue as @Hatzl. Instead, take a look at the newly released |
I've just opened #526 to solve this issue. This actually got me thinking about how we're doing (and exposing) validation. The return types are kinda all over the place and we should probably restrict some of these methods to
|
Describe the bug
If you call
form.validateAllFields("change")
and have initial form errors (e.g. empty required field) it returns the error.If you call it again, it only returns a empty array. Also it isn't showing errors from touched fields.
Is this behaviour intended? How can I also validate touched fields?
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/keen-visvesvaraya-qnn26j?file=%2Fsrc%2Findex.tsx%3A41%2C62
Steps to reproduce
Expected behavior
form.validateAllFields("change")
should always return errorsHow often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Form adapter
react-form
TanStack Form version
0.9.0
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: