Custom Field Meta does not updated until input touched after 1.26.0

Abierto
#1,980 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Ejecuta la reproducción de StackBlitz usando los archivos indicados en package.json, src/simple-form.tsx y src/App.tsx. Compara TanStack Form 1.26.0 con 1.27.7, siguiendo la actualización de meta de onMount y el comportamiento de renderizado de firstName. Se considera terminado cuando firstName está oculto inicialmente y se actualiza correctamente al cambiar color sin tocar firstName.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

v1
Describe the bug

I am using custom field meta's heavily, for example style={{ display: field.state.meta?.hidden ? 'none' : 'block' }}, for every field I have set of these meta's like dataSource, hidden, disabled, and others...

in example there is two field firstName and color, I have listener.onMount that hide firstName (through field.setMeta()) if color is "red", in v1.26.0 and before it works well, after this version it does not hide until I touch the field firstName

example use v1.26.0, change package version to see the problem

Your minimal, reproducible example

https://stackblitz.com/edit/vitejs-vite-kqn6fekp?file=package.json,src%2Fsimple-form.tsx,src%2FApp.tsx&terminal=dev

Steps to reproduce
  1. notice in example field firstName is hidden by default (it is hidden in onMount)
  2. change the color to "green" field firstName will appear
  3. upgrade tanstack-form version to newer version
  4. after refresh you will notice firstName now is not hidden
  5. touch the field firstName now it will hide
Expected behavior

compare by previous steps I exp expect:

  1. notice in example field firstName is hidden by default (it is hidden in onMount)
  2. change the color to "green" field firstName will appear
  3. upgrade tanstack-form version to newer version
  4. field firstName should still hidden by default
How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform
  • OS: [linux, windows]
  • Browsers: [chrome, vivaldi]
TanStack Form adapter

react-form

TanStack Form version

1.27.7

TypeScript version

5.9.3

Additional context

No response

Lenguaje dominante
TypeScript
Estrellas
6.8k
Forks
705
Merge medio
1 d 12 h
PR fusionados (30 d)
14

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TanStack/form

Todos los issues de TanStack/form

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.