Skip to content

fix(trigger): keep registered nested errors when trigger targets their parent - #13732

Merged
bluebill1049 merged 1 commit into
react-hook-form:masterfrom
soroush5:fix/trigger-parent-keeps-nested-errors
Sep 11, 2026
Merged

bluebill1049 merged 1 commit into
react-hook-form:masterfrom
soroush5:fix/trigger-parent-keeps-nested-errors

Conversation

@soroush5

Copy link
Copy Markdown
Contributor

Triggering a parent name (e.g. trigger('address')) with a resolver wiped that whole error subtree from form state, even when nested fields like address.street were registered and invalid. Trigger returned false while errors showed nothing, so no message could render.

This keeps the previous orphan-container fix intact: the parent container is only skipped when no registered field exists beneath it.

…r parent

Only skip setting a parent error container when no registered field
exists beneath it, so trigger('address') still surfaces
address.street errors instead of wiping them.
@bluebill1049
bluebill1049 merged commit d2b757f 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