Skip to content

Commit

Permalink
Fix Node.textContent incorrectly appending the textContent of subsequ…
Browse files Browse the repository at this point in the history
…ent siblings
  • Loading branch information
santala committed Feb 25, 2024
1 parent 0c51bbc commit 6768867
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wet-jars-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remote-dom/polyfill": patch
---

Fix Node.textContent incorrectly appending the textContent of subsequent siblings
3 changes: 2 additions & 1 deletion packages/polyfill/source/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ export class Node extends EventTarget {
const sibling = node[NEXT];
if (sibling) walk(sibling);
}
walk(this);
const child = this[CHILD];
if (child) walk(child);
return text;
}

Expand Down

0 comments on commit 6768867

Please sign in to comment.