TanStack / form

🤖 Powerful and type-safe form state management for the web. TS/JS, React Form, Solid Form, Lit Form and Vue Form.

Home Page:https://tanstack.com/form

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Moving subfields of array field mix their values

pedro757 opened this issue · comments

Describe the bug

When the input is still idle (I mean undefined) and you try to change its position it takes the value of other subfields. It messes things up.

Codesandbox

https://codesandbox.io/p/sandbox/focused-pond-s96spf?file=%2Fsrc%2FApp.js%3A169%2C8

Steps to reproduce

  1. Try to move the empty subfields dragging and dropping in other position
  2. Now try to move subfields with non-empty values

Expected behavior

I expect it to keep its value.

I think this is a bug with our moveValue method. I'll investigate in a bit