Skip to content

Commit

Permalink
Update: Don't set key index if already set
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Oct 17, 2024
1 parent 0a57b6c commit 570459b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Resources/Private/Editor/Repeatable/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ function Repeatable(props) {
let newValue = value ? clone(value) : [];
// add an fixed index to the value
newValue = newValue.map((item, idx) => {
if (item[KEY_PROPERTY]) {
return item;
}
return {
...item,
[KEY_PROPERTY]: nanoid(),
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/Plugin.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Resources/Public/Plugin.js.map

Large diffs are not rendered by default.

0 comments on commit 570459b

Please sign in to comment.