Repository navigation
fix: ignore stale built-in validation result after reset in handleSubmit - #13761
Conversation
|
I think there’s still a stale validation case here with form-level
So if Could we also cover the form-level async |
|
Good catch, you are right. Pushed a follow-up: shouldAbort is now threaded into validateForm too, so a late props.validate result after reset no longer touches errors. Added a form-level regression test (fails before, passes after), full suite green. |
|
nice, could you resolve the conflicts? |
b6ce545 to
42268f6
Compare
|
Rebased and reworked on the new architecture: the guard now lives inside executeBuiltInValidation right after each validateField, so a late field result after reset never reaches formState.errors either. Verified the gap first: the 3 regression tests fail on current master (stale onInvalid still fires), all green with this fix, full suite 1396 passed. |
|
Thanks for merging. |
If reset() runs while handleSubmit awaits an async field validate, the late result still landed as a stale error or a stale onValid call. The in-flight result is now discarded once a reset happened, same guard style as #13733.
Verified: 2 new tests fail before and pass after, full suite green.
Fixes #13760