From bf8a0f7cbe1243e371869050a6928159cd5ce3db Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Fri, 24 Aug 2018 12:16:09 -0300 Subject: [PATCH] Set style attribute correctly when spread attr present --- src/shared/dom.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/dom.js b/src/shared/dom.js index d428e92f1c..accd2abecf 100644 --- a/src/shared/dom.js +++ b/src/shared/dom.js @@ -87,7 +87,9 @@ export function setAttribute(node, attribute, value) { export function setAttributes(node, attributes) { for (var key in attributes) { - if (key in node) { + if (key === 'style') { + node.style.cssText = attributes[key]; + } else if (key in node) { node[key] = attributes[key]; } else { if (attributes[key] === undefined) removeAttribute(node, key); @@ -238,4 +240,4 @@ export function addResizeListener(element, fn) { element.removeChild(object); } }; -} \ No newline at end of file +}