form
form copied to clipboard
insertFieldValue replaces item instead of adding a new one and shift existing items
Describe the bug
insertFieldValue (and insertValue) currently replaces the value at the given index.
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-form-tbctpy?file=src%2Findex.tsx
Steps to reproduce
- Click the "Insert Above" button
- Look at the input next to the button
Expected behavior
A new item is added to the array at the given index, previous items are not touched, subsequent items are shifted by 1 (to make room for the new item).
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
MacOS
TanStack Form adapter
react-form
TanStack Form version
0.19.4
TypeScript version
No response
Additional context
No response