Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually setting field errors with setFieldMeta doesn't seem to work. #1386

Open
obinna-okechukwu-01 opened this issue Apr 7, 2025 · 0 comments

Comments

@obinna-okechukwu-01
Copy link

Describe the bug

I have a large form that's broken down into section and i'll like to validate a section of the form manually especially when I have a field that is required but doesn't have a default value - without it being touched - I need a way to set errors on the field after manually validating.

I put together a small demo here https://stackblitz.com/edit/vitejs-vite-fp5zqe1l?file=src%2FApp.tsx

Your minimal, reproducible example

https://stackblitz.com/edit/vitejs-vite-fp5zqe1l?file=src%2FApp.tsx

Steps to reproduce

  1. Update a field's error state using the setFieldMeta function.

Following the demo provided, if you click on the button to manually run validation, it uses the setFieldMeta function to set the errors meta, but it doesn't get updated.

Expected behavior

I expect that the field error state should be updated when set using the setFieldMeta function.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • Browser

TanStack Form adapter

react-form

TanStack Form version

1.2.4

TypeScript version

5

Additional context

No response

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

No branches or pull requests

1 participant