Replies: 1 comment
-
Hey! I am investigating the same problem, is there any possible solution? |
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.
-
Hi,
I've been trying for a while now to figure out how to properly handle async validation (using the validate function). Other people have raised this question a few times:
#9028
#1688
#9791
But I have not been able to understand how I am supposed to make sure that only validations triggered by the current value affects the validity of the field. Async validations for long since irrelevant values should not in my option be allowed to come stumbling in late to the party shouting "Invalid!" when the current value is perfectly valid.
By design apparently (#1688 (comment)) RHF does not abort old validations. But I'm not sure how to do this myself? Even if can determine that a particular validation is indeed old there does not seem to be a way of aborting. No matter what the async validation function returns it will overwrite the current field validity. I tried throwing an error just for the sake of elimination but that was not appreciated by RHF..
Has anyone any idea to share on how I should proceed?
Beta Was this translation helpful? Give feedback.
All reactions