How to reset field error manually? #1449
Replies: 1 comment
-
I am sorry, my bad, there was an error in my validator. Both options I mentioned works. It would be great to have something line "resetErrors" or "resetMeta" on field and/or resetFieldErrors on form (resetFieldMeta exists on form, but it resets all fields meta, not specific one) though |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've build complex form with tanstack form. Gotta admit, with withForm, fieldComponents etc it's even more awesome tool that it was before. It helped to build structure, make cleaner code, it's really good. But I've run into a problem. My form is complex. I have delivery method select and depending on selected delivery method selected some fields appear and disappear. So, the problem is: user chooses delivery method which required address, doesn't enter an address and presses submit, what, of course, shows an errors for this field and makes submit button disabled. But after that user changes for "pickup" method, so, no address required. I unmount this field, but error stays and it prevents the form from submitting. I've tried to add something like that
or that
but id didn't reset errors on field and because of that the submit button stays in disabled state
So, the question is: "Is there any way to reset the errors on unmounted fields?"
Beta Was this translation helpful? Give feedback.
All reactions