form
form copied to clipboard
solid-form's .removeValue(index) in Array form fields not behaving as expected, when removing an index, it replaces all the values with last value.
Describe the bug
when using array form field in tanstack solid form, removing an index causes all the other values to be replaced by the last value.
for example, if the array values are 1, 2, 3, 4, 5. Removing the value at the first index, results in 5, 5, 5, 5.
if the value 3 is removed, then the result is 1, 2, 5, 5.
Your minimal, reproducible example
https://stackblitz.com/edit/solidjs-templates-pczeqty5?file=src%2FApp.jsx
Steps to reproduce
- remove the first value "apple".
- you can see that the other values become "netflix" (the last value)
or
- remove the second value "google"
- you can see that the values below it all becomes "netflix"
Expected behavior
If the array is 1, 2, 3, 4, 5. and the value 3 is removed, result should be 1, 2, 4, 5
How often does this bug happen?
Every time
Screenshots or Videos
https://github.com/user-attachments/assets/5bd26c25-a1cb-4b0a-ba4e-55c2e8de2901
Platform
macos
TanStack Form adapter
solid-form
TanStack Form version
1.12.2
TypeScript version
No response
Additional context
No response