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
From what I find, the onChange validator will rightly handle the blurring by maintaining errors in the state.meta.errors. onSubmit however, is causing the blur event to clear the errors.
I might be wrong but I think this is where the problem is inFieldApi.ts:
/** * when we have an error for onSubmit in the state, we want * to clear the error as soon as the user enters a valid value in the field */constsubmitErrKey=getErrorMapKey('submit')if(this.state.meta.errorMap[submitErrKey]&&cause!=='submit'&&!hasErrored){this.setMeta((prev)=>({
...prev,errorMap: {
...prev.errorMap,[submitErrKey]: undefined,},}))}
Since blur's cause is not submit, but rather "change" in the case where we blur out of a field after submitting, it won't remap the hasErrored or the errorMap. I don't know if this is by design so I will let a maintainer comment on this.
Describe the bug
A submit error is removed on blur of a field when the value didn't change.
Your minimal, reproducible example
https://codesandbox.io/p/devbox/hungry-sanderson-ycs6rd
Steps to reproduce
Expected behavior
The error which occured on submit is not removed on blur when the value during focus didn't change.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
TanStack Form adapter
react-form
TanStack Form version
1.0.2
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: