-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the problem
There's should be an easier way to add, remove, or sort items in a field array than something like this:
<button onclick={() => form.fields.arr.set([...form.fields.arr.value(), ""])}>
Add Item
</button>
<button onclick={() => {
const values = form.fields.arr.value();
values.pop();
form.fields.arr.set(values)
}>
Remove Last Item
</button>
Describe the proposed solution
Array methods:
<button onclick={() => form.fields.arr.push("")}>
Add Item
</button>
<button onclick={() => form.fields.arr.pop()}>
Remove Last Item
</button>
Alternatives considered
Helper functions or a class with static methods
<button onclick={() => push(form.fields.arr, "")}>
Add Item
</button>
<button onclick={() => FieldArr.pop(form.fields.arr)}>
Remove Last Item
</button>
Importance
would make my life easier
Additional Information
No response
Metadata
Metadata
Assignees
Labels
No labels