MVCoconut / coconut.vdom

Coconut rendering through virtual-dom.
The Unlicense
19 stars 8 forks source link

SVG class is not handled properly #26

Closed nspitko closed 4 years ago

nspitko commented 4 years ago

Likely affects all SVG elements.

I can mock up a full repro if needed, but the basic steps are easy enough. Just make a view with <path class="test" />. It will compile as expected, but at runtime you'll get this:

Uncaught TypeError: Cannot assign to read only property 'className' of object '#<SVGPathElement>'

Per the spec, SVGElement's className is a read only SVGAnimatedString instance, and also deprecated. Spec suggests using classList instead, but setAttribute('class', ... ) would probably work if you're looking to avoid classList for other reasons.