diff --git a/src/auto-complete-element.ts b/src/auto-complete-element.ts index 76a742e..9a90c10 100644 --- a/src/auto-complete-element.ts +++ b/src/auto-complete-element.ts @@ -73,6 +73,12 @@ export class AutoCompleteElement extends HTMLElement { connectedCallback(): void { if (!this.isConnected) return this.#reattachState() + + new MutationObserver(() => { + if (!state.get(this)) { + this.#reattachState() + } + }).observe(this, {subtree: true, childList: true}) } disconnectedCallback(): void {