`withFieldGroup` array handling with nested

Ouverte
#1,648 4 commentaires 2 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
38/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Calme
Stack technique
react, typescript
Domaine
frontend

Piste de recherche

Commencez par la reproduction CodeSandbox liée, en vous concentrant sur withFieldGroup et le composant SingleFieldWithReorder lors du déplacement des valeurs de tableaux imbriqués vers le haut et vers le bas. Suivez pourquoi les valeurs imbriquées rendues divergent du mapping du tableau parent, et vérifiez si fields et form devraient être exposés à la fonction de rendu. C’est terminé lorsque le groupe imbriqué reste synchronisé et que le comportement des render props est résolu ou documenté.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

v1 v2: needs investigation
Describe the bug

When combining the withFieldGroup for a complex array handling, the nested array element seems out of sync with the actual value of the group.

I've just tested while passing the root form to the SingleFieldWithReorder and the nested elements keep being out of sync (regarding the json value displayed)


Also, this is unrelated but when looking at the extra props of the render function, it seems to pass the fields and the form. Idk if this is expected or if the props must be sanitized when rendering to remove theses values before passing the props to the render method. (They are undocumented and not typed)

Your minimal, reproducible example

https://codesandbox.io/p/devbox/misty-monad-8t29lx?workspaceId=ws_PkVpfRWHUp5vMscgD59gVj

Steps to reproduce
  1. Try to move the value with the move down|move up buttons.
  2. See that the values from the base array mapping are correct, but the values rendered in the element aren't.
Expected behavior

I think the nested group value should remain sync with the array mapping from the parent group

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform
  • Browser: Tested on chrome 138.0.7204.183 (Official Build) (64-bit)
TanStack Form adapter

react-form

TanStack Form version

v1.15.1

TypeScript version

No response

Additional context

No response

Langage dominant
TypeScript
Étoiles
6.8k
Forks
711
Merge moyen
1 j 6 h
PR mergées (30 j)
12

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TanStack/form

Toutes les issues de TanStack/form

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.