From bec8cea583af5d6a2a2b57ae70831a27d87ea3ac Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Mon, 25 Apr 2022 14:17:07 +0200 Subject: [PATCH] fix for breaking in #725 --- src/platform/web/ui/general/TemplateView.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/platform/web/ui/general/TemplateView.ts b/src/platform/web/ui/general/TemplateView.ts index 7f7f4c13..d6e3dd3f 100644 --- a/src/platform/web/ui/general/TemplateView.ts +++ b/src/platform/web/ui/general/TemplateView.ts @@ -285,10 +285,12 @@ export class TemplateBuilder { elNS(ns: string, name: string, attributesOrChildren?: Attributes | Children, children?: Children): ViewNode { let attributes: Attributes | undefined; - if (attributes !== undefined && isChildren(attributes)) { - children = attributes; - } else { - attributes = attributesOrChildren as Attributes; + if (attributesOrChildren) { + if (isChildren(attributesOrChildren)) { + children = attributesOrChildren as Children; + } else { + attributes = attributesOrChildren as Attributes; + } } const node = document.createElementNS(ns, name);