Skip to content

Commit

Permalink
Fix html clearing on rebuild
Browse files Browse the repository at this point in the history
There was a regression in #1605 that broke html clearing on rebuilds, which would cause all assets to get duplicated in the DOM.

(After `removeChild(target)`, `target.nextSibling` goes undefined.)

Fixes #1660.
  • Loading branch information
ef4 committed Nov 14, 2023
1 parent 138272d commit 071fee9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/core/src/ember-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ class Placeholder {

clear() {
let { start, end, parent } = this;
let target = start.nextSibling;

while (target && target !== end) {
parent.removeChild(target);
target = target.nextSibling;
while (start.nextSibling && start.nextSibling !== end) {
parent.removeChild(start.nextSibling);
}
}

Expand Down

0 comments on commit 071fee9

Please sign in to comment.