# HG changeset patch # User cin # Date 2021-05-26 21:15:46 # Node ID c276b9b7fa833242d1bf75eeeaae9924feee51e8 # Parent f8b14ecb1f6f570fae97e2de1917c9231cdeeabc Fixed startupWidgets for nodes are not of the Element type. diff --git a/djx/src/main/ts/tsx/traits.ts b/djx/src/main/ts/tsx/traits.ts --- a/djx/src/main/ts/tsx/traits.ts +++ b/djx/src/main/ts/tsx/traits.ts @@ -134,13 +134,15 @@ export function emptyNode(target: Node) */ export function startupWidgets(target: Node | _WidgetBase, skipNode?: Node) { if (isNode(target)) { - const w = registry.byNode(target); + const w = isElementNode(target) ? registry.byNode(target) : undefined; if (w) { - w.startup && w.startup(); + if (w.startup) + w.startup(); } else { - registry.findWidgets(target, skipNode).forEach(w => w.startup()); + registry.findWidgets(target, skipNode).forEach(x => x.startup()); } } else { - target.startup && target.startup(); + if(target.startup) + target.startup(); } } \ No newline at end of file