Skip to content

Commit a074734

Browse files
authored
fix: ensure we clear down each block opening anchors from document (#11740)
* fix: ensure we clear down each block opening anchors from document * fix: ensure we clear down each block opening anchors from document
1 parent 401c8b2 commit a074734

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/silent-rabbits-join.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte": patch
3+
---
4+
5+
fix: ensure we clear down each block opening anchors from document

packages/svelte/src/internal/client/dom/blocks/each.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function reconcile(array, state, anchor, render_fn, flags, get_key) {
280280
item = items.get(key);
281281

282282
if (item === undefined) {
283-
var child_open = push_template_node(empty());
283+
var child_open = empty();
284284
var child_anchor = current ? current.o : anchor;
285285

286286
child_anchor.before(child_open);
@@ -407,6 +407,7 @@ function reconcile(array, state, anchor, render_fn, flags, get_key) {
407407
for (var i = 0; i < to_destroy.length; i += 1) {
408408
var item = to_destroy[i];
409409
items.delete(item.k);
410+
remove(item.o);
410411
link(item.prev, item.next);
411412
}
412413
});

0 commit comments

Comments
 (0)