fix: polyfill Element.replaceChildren (#7034)

This commit is contained in:
David Luzar 2023-09-24 19:07:35 +02:00 committed by GitHub
parent 4db73a7f95
commit 556175558a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;