-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class
attribute does not work for SVG nodes
#47
Comments
Hi, For as far as I know, the problem you are having is not specific to SVG but to all type elements, Kind regards, |
Hello, First of all, maquette did not support the class attribute until version 2.2, because we wanted to encourage people to use the hyperscript notation (your second line). Because we wanted to support JSX in version 2.2, we stopped blacklisting 'class'. It seems we missed supporting SVG here. In SVG, className is not a string, so we have to switch to classList as you pointed out. Thanks for pointing this out. |
One not of warning: Using SVG classes currently does not work IE11, see #48 |
I see, thanks for the clear explanation and the quick fix! Much appreciated :) |
Hi,
I've been playing around rendering SVG with maquette (awesome that it handles namespacing automatically btw!) and have discovered that setting the
class
attribute on an SVG node doesn't work, but setting classes in the vnodeSelector or using theclasses
attribute does.For example:
It looks like this is because SVG nodes support updating the
classList
attribute (set from the vnodeSelector and classes) but not theclassName
attribute (set from the class attribute). Is there a reason that className is used here? - could it be changed to classList or have an exception added for SVG nodes?Thanks!
The text was updated successfully, but these errors were encountered: