From 556175558a7f62b42e992f9b3b07f3b553167203 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Sun, 24 Sep 2023 19:07:35 +0200 Subject: [PATCH] fix: polyfill `Element.replaceChildren` (#7034) --- src/polyfill.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/polyfill.ts b/src/polyfill.ts index cc4891b4..b8b080f7 100644 --- a/src/polyfill.ts +++ b/src/polyfill.ts @@ -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;