Skip to content

Commit

Permalink
Merge pull request #1684 from kaisermann/spread-attr-style
Browse files Browse the repository at this point in the history
Set style attribute correctly when spread attr present
  • Loading branch information
Rich-Harris authored Aug 24, 2018
2 parents d6fe9b4 + 54dc1e5 commit fe8e31a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/shared/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -238,4 +240,4 @@ export function addResizeListener(element, fn) {
element.removeChild(object);
}
};
}
}

0 comments on commit fe8e31a

Please sign in to comment.