From 427e55018158fd98e0ac5b2050483b4f708ca351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E5=AE=87=E7=A5=A5?= Date: Wed, 1 Jan 2025 01:38:40 +0800 Subject: [PATCH] fix exception on attachShadow --- src/lib/zero-md-base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/zero-md-base.js b/src/lib/zero-md-base.js index 135a556..f586c20 100644 --- a/src/lib/zero-md-base.js +++ b/src/lib/zero-md-base.js @@ -72,7 +72,7 @@ export default class ZeroMdBase extends HTMLElement { async connectedCallback() { if (!this._loaded) { await this.load() - if (!this.hasAttribute('no-shadow')) this.root = this.attachShadow({ mode: 'open' }) + if (!this.hasAttribute('no-shadow')) this.root = this.shadowRoot ?? this.attachShadow({ mode: 'open' }) this.root.prepend( this.frag(`
`) )