Repository navigation
feat(form-core): allow form validators to omit field schema issues - #2513
parmar-harshit wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 2
Please check the settings in the CodeRabbit UI or the
|
🦋 Changeset detectedLatest commit: a00a5e8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Changes
Fixes #2402.
Issue: When a schema finds an error in one field, such as an invalid email, the error appears both beside the field and in the form's error list. This makes it difficult to show messages that apply to the whole form separately.
Implementation: I added
includeFieldIssuesInFormErrors: falseto each form validator. With this option, field errors stay beside their fields, while the form's error list contains only errors without a field path. The existing behavior remains the default. I added tests, documentation, and a changeset.Proof: The regression tests cover the default and new behavior, including mount and server validation. Locally,
pnpm test:prcompleted 190 tasks; only the existing Octanetest:knipcheck failed, with the same findings on an untouched branch.Checklist
pnpm test:pr, or these tests do not apply to this pull request.Release Impact
Local preview — phone entered: Both forms still show the invalid email beside the Email field. The phone number satisfies the contact-method requirement. The default form list repeats the email error; the new option’s form list shows “None.”
Local preview — no contact method entered: Both forms show the invalid email beside the field. The default form list shows both the email and contact-method errors; the new option’s list shows only the contact-method error.