diff --git a/element.js b/element.js index 23e5b9a..dee8cbb 100644 --- a/element.js +++ b/element.js @@ -56,6 +56,13 @@ export default Class => { } } + proto.insert = function(...args) { + return (this.shadowRoot || this).append(...args) + } + proto.replace = function(...args) { + return (this.shadowRoot || this).replaceChildren(...args) + } + Object.prototype[Symbol.toPrimitive] = function(hint) { const name = `to${hint.replace(/./, e => e.toUpperCase())}` return name in this