Fix: For css class addition to svg elements
This commit is contained in:
parent
3666aa747e
commit
f1f77c80b3
2 changed files with 12 additions and 1 deletions
|
|
@ -358,7 +358,9 @@ module.exports = function($window, onevent) {
|
|||
if (value) element.setAttribute(key, "")
|
||||
else element.removeAttribute(key)
|
||||
}
|
||||
else element.setAttribute(key, value)
|
||||
else element.setAttribute(
|
||||
key === "className" ? "class" : key,
|
||||
value)
|
||||
}
|
||||
}
|
||||
function setLateAttrs(vnode) {
|
||||
|
|
|
|||
|
|
@ -76,4 +76,13 @@ o.spec("attributes", function() {
|
|||
o(a.dom.attributes["href"]).equals(undefined)
|
||||
})
|
||||
})
|
||||
o.spec("svg class", function() {
|
||||
o("when className is specified then it should be added as a class", function() {
|
||||
var a = {tag: "svg", attrs: {className: "test"}}
|
||||
|
||||
render(root, [a]);
|
||||
|
||||
o(a.dom.attributes.class.nodeValue).equals("test")
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue