Skip to content

Validation does not work fine for a form field without an associated component #1865

@Jaime02

Description

@Jaime02

Describe the bug

Hello, I am using a form with a field which is not associated to a <form.AppField> component.

OLD BEHAVIOUR tanstack-form version 1.23.8:
Initially, I am getting a validation error, which is correct. Then I change the field value using form.setFieldValue to a valid value, but the form validation error is still there.

NEW BEHAVIOUR tanstack-form version 1.27.5:
The validation errors are not shown at all ☹️

Your minimal, reproducible example

OLD EXAMPLE tanstack-form version 1.23.8:
https://stackblitz.com/edit/tanstack-form-kurxzdck?file=src%2Findex.tsx

NEW EXAMPLE tanstack-form version 1.27.5:
https://stackblitz.com/edit/tanstack-form-bgycyyay

Steps to reproduce

  1. Create a form. Define a field without an associated HTML component.
  2. The form validation will not work fine, changing the field value using form.setFieldValue will not update the form validation state properly

Expected behavior

A form field should not require an associated component for the validation to work properly

How often does this bug happen?

Every time

Platform

Windows
Chrome
@tanstack/[email protected], @tanstack/[email protected]

TanStack Form version

1.23.8, 1.27.5

(Updated 21/12/25 because the behaviour of the bug has changed in the latests tanstack/react-form updates)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions