From c5226669277cbbaab2147436c978fb9e6f2e6706 Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Sun, 3 Apr 2022 12:51:45 +0200 Subject: [PATCH] fix: fixed bad use of get/hasAttribute --- src/ui/UINode.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/ui/UINode.ts b/src/ui/UINode.ts index 319bc07..a6b153b 100644 --- a/src/ui/UINode.ts +++ b/src/ui/UINode.ts @@ -69,18 +69,10 @@ export function h< const attribute = (attributes as any)[key]; if (attribute) { if (attribute instanceof Ref) { - if (element.hasAttribute(key)) { - element.setAttribute(key, attribute.val); - attribute.watch((newVal) => { - if (element.hasAttribute(key)) { - element.setAttribute(key, newVal); - } - }); - } + (element as any)[key] = attribute.val; + attribute.watch((newVal) => (element as any)[key] = newVal); } else { - if (element.hasAttribute(key)) { - element.setAttribute(key, attribute); - } + (element as any)[key] = attribute; } } }