Skip to content

feat(form-core): allow form validators to omit field schema issues - #2513

Open
parmar-harshit wants to merge 1 commit into
TanStack:v2-octanefrom
parmar-harshit:fix/issue-2402
Open

parmar-harshit wants to merge 1 commit into
TanStack:v2-octanefrom
parmar-harshit:fix/issue-2402

Conversation

@parmar-harshit

Copy link
Copy Markdown

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: false to 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:pr completed 190 tasks; only the existing Octane test:knip check failed, with the same findings on an untouched branch.

Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

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.”

WhatsApp Image 2026-12-03 at 11 36 45 PM

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.

WhatsApp Image 2026-12-03 at 11 36 00 PM

@coderabbitai

coderabbitai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 2

  • alpha
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@changeset-bot

changeset-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a00a5e8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@tanstack/form-core Minor
@tanstack/angular-form Minor
@tanstack/form-devtools Patch
@tanstack/lit-form Patch
@tanstack/octane-form Patch
@tanstack/preact-form Patch
@tanstack/react-form-nextjs Minor
@tanstack/react-form-start Minor
@tanstack/react-form Minor
@tanstack/solid-form Minor
@tanstack/svelte-form Minor
@tanstack/vue-form Minor
@tanstack/react-form-devtools Patch
@tanstack/solid-form-devtools Patch

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

This branch has not been deployed

No deployments
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.

1 participant