Skip to content

Commit

Permalink
Fix key attribute of list elements not accounting for deleted entries
Browse files Browse the repository at this point in the history
  • Loading branch information
weisintai committed Oct 3, 2023
1 parent ef990f8 commit 4eda4bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ListExtender.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@
if (canRemove(input.target, thing) && thing.listSize > 1) {
thing.element.removeChild(input.target.parentElement);
thing.listSize--;
thing.element.childNodes.forEach((e, index) => {
e.setAttribute("key", index + 1);
});
} else if (validate(input.target) && customChecks(input.target, thing)) {
turnToList(input.target, thing);
}
Expand Down

0 comments on commit 4eda4bb

Please sign in to comment.