How to use validatorsAsync for a "submit on change" behavior? #1444
Unanswered
luisfontes
asked this question in
Q&A
Replies: 0 comments
No Sign up for free
to join this conversation on GitHub.
Already have an account?
No Sign in to comment
-
Hello,
I'm building a form where the desired behavior is for inputs to be saved 'as you type'. I was able to do that using async validators + debounce:
So far, that's working fine. However, I need to use the above boilerplate for all fields in all forms. Validation needs to run at a field level instead of the form level, as I only want to react to the active field being updated and save only its value, instead of saving the whole form on every update.
Is there a way to abstract that validation logic into a form component or something similar?
I've tried using withForm but wasn't able to get it to work (onChange validator running, but errors were not propagated to the field)
Any suggestions on how to correctly abstract the validator's logic, or how I could achieve the desired save-as-you-type behavior without that much boilerplate?
Beta Was this translation helpful? Give feedback.
All reactions