Skip to content

fix(resetField): clear stale validating state for the field - #13735

Merged
bluebill1049 merged 1 commit into
react-hook-form:masterfrom
soroush5:fix/resetfield-clear-stale-validating
Sep 11, 2026
Merged

bluebill1049 merged 1 commit into
react-hook-form:masterfrom
soroush5:fix/resetfield-clear-stale-validating

Conversation

@soroush5

Copy link
Copy Markdown
Contributor

Calling resetField while a field has an async validation in flight left its validatingFields entry behind, so formState.isValidating and getFieldState(name).isValidating stayed true even though nothing was pending anymore. unregister and reset already clear this state; resetField was the odd one out.

The clear runs before resetField's internal setValue, so when the reset itself starts a new validation pass the fresh entry is kept and isValidating correctly stays true. The final emit now recomputes isValidating from validatingFields, mirroring unregister.

@bluebill1049
bluebill1049 merged commit 39cfba0 into react-hook-form:master Sep 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants