Skip to content

Commit

Permalink
check for typeof attribute value, if is string use setAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
enapupe committed Jan 17, 2017
1 parent 99ad1f3 commit 69bd4bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dom/index.js
Expand Up @@ -64,7 +64,10 @@ export function setAccessor(node, name, old, value, isSvg) {
}
l[name] = value;
}
else if (name!=='list' && name!=='type' && !isSvg && name in node) {
else if (typeof value === 'string' && !isSvg && name in node) {
node.setAttribute(name, value);
}
else if (!isSvg && name in node) {
setProperty(node, name, value==null ? '' : value);
if (value==null || value===false) node.removeAttribute(name);
}
Expand Down

0 comments on commit 69bd4bd

Please sign in to comment.