Only validate touched/dirty fields #1722
Unanswered
Micnubinub
asked this question in
General
Replies: 1 comment
-
There's two requirements you have for showing errors:
Since you're using field components, you should use const isTouched = useStore(field.store, state => state.meta.isTouched)
const submissionAttempts = useStore(field.form.store, state => state.submissionAttempts)
const showError = isTouched || submissionAttempts > 0 |
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.
-
What's the best way to validate only the dirty fields in
onBlur
when only using one schema at the form level? i.e. If I both values are invalid, but onlyval1
has been touched the error should only be on value 1. However when the user tries to submit, then we do a full validateBeta Was this translation helpful? Give feedback.
All reactions