Skip to content

Commit

Permalink
fix: polyfill Element.replaceChildren (excalidraw#7034)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelle authored Sep 24, 2023
1 parent 4db73a7 commit 5561755
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,12 @@ const polyfill = () => {
configurable: true,
});
}

if (!Element.prototype.replaceChildren) {
Element.prototype.replaceChildren = function (...nodes) {
this.innerHTML = "";
this.append(...nodes);
};
}
};
export default polyfill;

0 comments on commit 5561755

Please sign in to comment.