New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to insert multiple items at once when using useFieldArray #3071
Comments
Thanks @dwiyatci 👍 adding to the board. |
@bluebill1049 I'm sorry to bother but this seems to become a requirement in my project sooner than I expected. 😣😖😫 While waiting for the up-votes, do you have any idea of a rather clean workaround to realise this with the current lib API? (clearly multiple actions in a loop won't work as mentioned in #2710) |
hey @dwiyatci I will look into it. |
I don't even know what i have built... can you test this out: https://codesandbox.io/s/react-hook-form-usefieldarray-insert-test-z8fyw?file=/src/index.js |
@bluebill1049 Ohh... WOW. So you're sayin' this turns out to have been implemented all along? :D |
Also, if anyone came here looking for a way to append/prepend multiple sets of fields at once, then the |
Hi! I believe this is related to #2710. Currently I'm developing a "toggle multiple fields" feature in my project wherein I've got to be able to toggle the middle field items (form controls) ON/OFF. Here's some hypothetical snippet:
While I can comfortably use
remove([])
API to remove multiple field item (for toggling off) but I don't have its counterpartinsert([])
(for toggling on).Describe the solution you'd like
Support
insert([{ index, value }, { index, value }, ...], { shouldFocus })
. 🙂Thank you 🙇🏻♂️
The text was updated successfully, but these errors were encountered: