From a93cb98b61260cedce179dd522aad34f541619f1 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 1 May 2018 11:06:57 +0100 Subject: [PATCH] fix(hdom): boolean attrib reset/removal --- packages/hdom/src/dom.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hdom/src/dom.ts b/packages/hdom/src/dom.ts index 3ccc7ef464..f7ab64d4d4 100644 --- a/packages/hdom/src/dom.ts +++ b/packages/hdom/src/dom.ts @@ -136,7 +136,7 @@ export function setAttrib(el: Element, id: string, val: any, attribs?: any) { } } } else { - el.removeAttribute(id); + el[id] ? (el[id] = null) : el.removeAttribute(id); } return el; } @@ -167,7 +167,7 @@ export function removeAttribs(el: Element, attribs: string[], prev: any) { if (a.indexOf("on") === 0) { el.removeEventListener(a.substr(2), prev[a]); } else { - el.removeAttribute(a); + el[a] ? (el[a] = null) : el.removeAttribute(a); } } }