From 76b6a6ec1ff32db5d1ca87fec6dba13e7acb3595 Mon Sep 17 00:00:00 2001 From: Vadim Cebaniuc Date: Sat, 13 Jul 2019 04:13:48 +0300 Subject: [PATCH] Remove null and undefined attributes set_attributes() should delete `null` or `undefined` attributes. I meet the issue for this case ``` vs ``` --- src/runtime/internal/dom.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts index 452347dc29..89025c881c 100644 --- a/src/runtime/internal/dom.ts +++ b/src/runtime/internal/dom.ts @@ -100,7 +100,7 @@ export function set_attributes(node: Element & ElementCSSInlineStyle, attributes for (const key in attributes) { if (key === 'style') { node.style.cssText = attributes[key]; - } else if (key in node) { + } else if (key in node && attributes[key] != null) { node[key] = attributes[key]; } else { attr(node, key, attributes[key]);