Skip to content

Commit 3696da4

Browse files
authored
Merge pull request #2369 from daftspunk/patch-1
Fixes leaky savedInputChecked across multiple instances
2 parents ddd0597 + 0a88f9a commit 3696da4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Sortable.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,8 +1555,11 @@ Sortable.prototype = /** @lends Sortable.prototype */ {
15551555
Sortable.clone =
15561556
Sortable.active = null;
15571557

1558-
savedInputChecked.forEach(function (el) {
1559-
el.checked = true;
1558+
let el = this.el;
1559+
savedInputChecked.forEach(function (checkEl) {
1560+
if (el.contains(checkEl)) {
1561+
checkEl.checked = true;
1562+
}
15601563
});
15611564

15621565
savedInputChecked.length =

0 commit comments

Comments
 (0)