onSubmit validation skips untouched fields when some fields have onBlur validation
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.7k
- Forks
- 682
- Merge medio
- 5 d 18 h
- PR fusionados (30 d)
- 7
Descripción
Describe the bug
When using TanStack Form with onBlur validation on all individual fields and onSubmit for the entire form, the onSubmit validation only validates fields that have been "touched" (focused/blurred). Fields that haven't been interacted with are skipped during form submission validation, even though they should be validated.
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-sviy39k3?file=src%2FApp.tsx
Steps to reproduce
- Focus and blur the "First Name" field (leave it empty)
- Leave the "Last Name" and "Email" fields completely untouched
- Click "Submit Form"
- Notice that only First Name shows an error, but Last Name and Email don't
Note: If you submit without blurring any fields, all fields are correctly validated and show errors.
Expected behavior
All fields should be validated on form submission, regardless of whether they have been touched or not. The onSubmit validation should validate the entire form schema, not just the "dirty" fields.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: macOS 15.5
- Browser: Chrome
- Version: 138.0.7204.184
TanStack Form adapter
react-form
TanStack Form version
v1.15.2
TypeScript version
v5.9.2
Additional context
No response
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con la reproducción vinculada de StackBlitz usando el adaptador react-form y sigue el comportamiento de validación del envío del formulario con la validación onBlur habilitada en cada campo. Confirma que, al enviar después de que solo First Name haya perdido el foco, también se informen errores para Last Name y Email, que no se han tocado, y conserva el comportamiento según el cual enviar inmediatamente valida todos los campos.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- react, typescript
- Área
- frontend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100