-
Notifications
You must be signed in to change notification settings - Fork 41
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
v4 error: Cannot set property className of #<SVGElement> which has only a getter #87
Comments
Also see https://stackoverflow.com/questions/37943006/unable-to-change-class-name-of-svg-element From comment: "In SVG className is an SVGAnimatedString (not a string). SVGAnimatedString has two main properties baseVal and animVal" |
to create |
@greghuc actually we have a chicken / egg problem there, as indeed even nested attributes would fail with SVG content so the previous hint about using |
@greghuc yup, just fixed in 4.1.8 so now your use case should be covered. Apologies for both confusion and early error, I knew that already from v3 but somehow forgot about it. |
@WebReflection thanks for looking into this so quickly. So to be clear, should I be using I had just switched all my So I want to be clear before I start testing with v4.1.8 again.. |
@greghuc use |
Hi there,
This is a very short and incomplete bug report for v4.1.5. I did a quick try of v4 in my app (currently on v3.2.2), and I'm seeing some errors. I don't have time right now to give a nice reproduction case, but I thought you might want to know about this error now, as you are actively developing v4..
So the error is
"Cannot set property className of #<SVGElement> which has only a getter"
.This happens with this code:
A quick Google shows up a related Github 2015 issue of this: adobe-webplatform/Snap.svg#414, where someone commented "SVG elements don't seem to respond to setting the className property."
The v4 release notes say "both class and style are handled as special attributes (among aria, data and ref) so that class=${value} now directly set className of the element".
So maybe setting className doesn't work on svgs?
The text was updated successfully, but these errors were encountered: