vantezzen / auto-form

🌟 A React component that automatically creates a @shadcn/ui form based on a zod schema.
https://vantezzen.github.io/auto-form/
MIT License
2.76k stars 99 forks source link

[Bug] Deletion doesn't work properly in Array Support #30

Open LarsArtmann opened 1 year ago

LarsArtmann commented 1 year ago

Just tried the Array Support on the demo website.

Screenshot 2023-09-17 at 17 26 08

When I deleted the first entry this happened:

Screenshot 2023-09-17 at 17 29 21

You can see the first entry is this there but the second one was 'delete'. If you look closely you can see it only removed it from the ui not the json underneath. After clicking the add button again it magically reappears.

Screenshot 2023-09-17 at 17 31 17

After testing with 3 entries, it looks like the delete button always (no matter witch entry) deletes the last entry (from the ui only)

teoboetti commented 9 months ago

Searching on react-hook-form, this should be the fix