Skip to content

Commit

Permalink
Add new array elements at the top
Browse files Browse the repository at this point in the history
  • Loading branch information
tplevko authored and lordrip committed Oct 10, 2024
1 parent d5a0d9b commit 12a59db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ListAddField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function ListAddField({ disabled = false, name, value, ...props }: ListAddFieldP
style={{ paddingLeft: "0", paddingRight: "0" }}
disabled={!limitNotReached}
onClick={() => {
!disabled && limitNotReached && parent.onChange((parent.value ?? []).concat([cloneDeep(value)]));
!disabled && limitNotReached && parent.onChange(([cloneDeep(value)]).concat(parent.value ?? []));
}}
{...filterDOMProps(props)}
label='THIS IS A LABEL'
Expand Down

0 comments on commit 12a59db

Please sign in to comment.