className can also be an instance of SVGAnimatedString if the element is an SVGElement. It is better to get/set the className of an element using Element.getAttribute and Element.setAttribute if you are dealing with SVG elements.
SVGElement's className is not a string and thus we currently set an invalid class (eg. [object SVGAnimatedString] udfqi3) when cloning this kind of elements.
Also it cannot be reassigned directly as it is a read-only property.
Using the provided getAttribute/setAttribute solve those problems.
https://developer.mozilla.org/en-US/docs/Web/API/Element/className#Notes
SVGElement's className is not a string and thus we currently set an invalid class (eg.
[object SVGAnimatedString] udfqi3
) when cloning this kind of elements. Also it cannot be reassigned directly as it is a read-only property.Using the provided
getAttribute
/setAttribute
solve those problems.Should also fix this issue https://github.com/tsayen/dom-to-image/issues/247