aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rx.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rx.ts b/src/rx.ts
index c46c2f5..edd28bf 100644
--- a/src/rx.ts
+++ b/src/rx.ts
@@ -384,7 +384,8 @@ function appendChild(state: State, element: Element, child: Html, lastAdded?: No
appendNode(element, childElement, lastAdded)
if (onmount !== undefined) {
- onmount(childElement)
+ // Wait for the element to be on the page
+ window.setTimeout(() => onmount(childElement), 0)
}
return {