From ddbb5b2fe89575e1019168418c308b397b367e44 Mon Sep 17 00:00:00 2001
From: Shiba <44804845+DeepDoge@users.noreply.github.com>
Date: Thu, 26 Dec 2024 22:30:49 +0000
Subject: [PATCH] double connected call issue fixed
---
lib/tags.ts | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/tags.ts b/lib/tags.ts
index 894e631..5516d89 100644
--- a/lib/tags.ts
+++ b/lib/tags.ts
@@ -284,9 +284,10 @@ export let WithLifecycle = HTMLElement>(
effect(callback: Lifecycle.OnConnected): Lifecycle.OffConnected {
this.#connectedCallbacks.add(callback)
- if (this.isConnected) {
+ // Commented because causes issues when custom element defined while also being already connected
+ /* if (this.isConnected) {
this.#disconnectedCallbacks.push(callback(this))
- }
+ } */
return () => {
this.#connectedCallbacks.delete(callback)