From 795a0f8273a1ba10e02beedde408863508cd9101 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Mon, 8 Jul 2019 17:53:06 -0700 Subject: [PATCH] Don't pass context attrs to HTML elements --- ui/components.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/components.ts b/ui/components.ts index 66193eb..fcf47e7 100644 --- a/ui/components.ts +++ b/ui/components.ts @@ -110,8 +110,10 @@ function applyContext(vnode, parentContext): void { for (const c of vnode) applyContext(c, parentContext); } else if (vnode && typeof vnode === "object" && vnode.tag) { const vc = Object.assign({}, parentContext, vnodeContext.get(vnode)); - vnodeContext.set(vnode, vc); - vnode.attrs = Object.assign({}, vc, vnode.attrs); + if (typeof vnode.tag !== "string") { + vnodeContext.set(vnode, vc); + vnode.attrs = Object.assign({}, vc, vnode.attrs); + } if (vnode.children && vnode.children.length) for (const c of vnode.children) applyContext(c, vc); }