Skip to content
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

Insert a new value in the middle of an array-like field #381

Open
tmporterSGSI opened this issue Jul 15, 2020 · 1 comment
Open

Insert a new value in the middle of an array-like field #381

tmporterSGSI opened this issue Jul 15, 2020 · 1 comment
Labels
legacy Issues or pull requests relating to the legacy version of the forms library

Comments

@tmporterSGSI
Copy link

Assume I have the following array-like field

"friends": [ "James", "Julie", "John" ]

and I want to insert a fourth value between "James" and "Julie".

What would be the recommended way to accomplish this without calling pushFieldValue() followed by multiple swapFieldValue() calls?

@tmporterSGSI
Copy link
Author

I suppose one option would be to use setFieldValue()'s callback argument to manually splice the new value into the middle of the array.

@crutchcorn crutchcorn added the legacy Issues or pull requests relating to the legacy version of the forms library label Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy Issues or pull requests relating to the legacy version of the forms library
Projects
None yet
Development

No branches or pull requests

2 participants