diff options
author | Joris | 2025-03-10 08:53:35 +0100 |
---|---|---|
committer | Joris | 2025-03-16 07:52:28 +0100 |
commit | 9185cee7c93f294a9ea1b5b0df3c2c81c16e1216 (patch) | |
tree | a1fe2c36f1d4c666dd6b5e7e265ab42ecedc1b37 /src | |
parent | e9be7fed1c7981dc913e2922a48801c5c41eee3d (diff) |
Call onmount when the element is on the page
Otherwise, using the element to call focus for example would not work.
Diffstat (limited to 'src')
-rw-r--r-- | src/rx.ts | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 { |