Skip to content

Commit

Permalink
chore: avoid unmounting component if it's not connected yet
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 committed Sep 13, 2024
1 parent 9825714 commit 2de0478
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/runtime-dom/src/apiCustomElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ export class VueElement
}

disconnectedCallback(): void {
// avoid unmounting component if it's not connected
if (!this.isConnected) return

this._connected = false
nextTick(() => {
if (!this._connected) {
Expand Down

0 comments on commit 2de0478

Please sign in to comment.