Skip to content

Commit

Permalink
fix: ensure we clear down each block opening anchors from document (#…
Browse files Browse the repository at this point in the history
…11740)

* fix: ensure we clear down each block opening anchors from document

* fix: ensure we clear down each block opening anchors from document
  • Loading branch information
trueadm committed May 23, 2024
1 parent 401c8b2 commit a074734
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silent-rabbits-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"svelte": patch
---

fix: ensure we clear down each block opening anchors from document
3 changes: 2 additions & 1 deletion packages/svelte/src/internal/client/dom/blocks/each.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function reconcile(array, state, anchor, render_fn, flags, get_key) {
item = items.get(key);

if (item === undefined) {
var child_open = push_template_node(empty());
var child_open = empty();
var child_anchor = current ? current.o : anchor;

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

0 comments on commit a074734

Please sign in to comment.