You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an issue I’ve encountered since my first use of TanStack Form in React Native, but I initially considered it trivial and ignored it.
In React Native, when validating with onChange, validation is triggered for all fields when handleSubmit is pressed, regardless of whether the inputs were touched or focused. The same behavior occurs with onSubmit validation.
However, with onBlur validation, pressing handleSubmit without interacting with any input does not trigger validation errors. The form also does not submit, which is expected since validation errors exist, but no errors are displayed to the user.
The onBlur validation only triggers after at least one input has been focused and then blurred (for example, by dismissing the keyboard).
Run "bun run android" and the form is present, just press "Submit" to see the validation not triggering
Ts.form.react.native.issue.webm
Expected behavior
The expected behavior is that validation errors should be triggered and displayed on submit, regardless of whether the user has focused any input fields.
Currently, when using onBlur validation in React Native, submitting the form without interacting with any input prevents the form from submitting, which indicates that the form correctly detects validation errors internally. However, no validation errors are visually displayed to the user until at least one field has been focused and blurred.
Describe the bug
This is an issue I’ve encountered since my first use of TanStack Form in React Native, but I initially considered it trivial and ignored it.
In React Native, when validating with
onChange, validation is triggered for all fields whenhandleSubmitis pressed, regardless of whether the inputs were touched or focused. The same behavior occurs withonSubmitvalidation.However, with
onBlurvalidation, pressinghandleSubmitwithout interacting with any input does not trigger validation errors. The form also does not submit, which is expected since validation errors exist, but no errors are displayed to the user.The
onBlurvalidation only triggers after at least one input has been focused and then blurred (for example, by dismissing the keyboard).I created a simple but realistic reproduction to demonstrate the issue. https://github.com/mdnjohn/tsform-rn-issue
Your minimal, reproducible example
GitHub repo
Steps to reproduce
Ts.form.react.native.issue.webm
Expected behavior
The expected behavior is that validation errors should be triggered and displayed on submit, regardless of whether the user has focused any input fields.
Currently, when using
onBlurvalidation in React Native, submitting the form without interacting with any input prevents the form from submitting, which indicates that the form correctly detects validation errors internally. However, no validation errors are visually displayed to the user until at least one field has been focused and blurred.How often does this bug happen?
Every time
Screenshots or Videos
Ts.form.react.native.issue.webm
Platform
OS: Android
TanStack Form adapter
react-form
TanStack Form version
1.29.1
TypeScript version
5.9.2
Additional context
No response