Skip to content
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

Styles aren't applied for root svg element #52

Open
juusee opened this issue Mar 8, 2019 · 0 comments
Open

Styles aren't applied for root svg element #52

juusee opened this issue Mar 8, 2019 · 0 comments

Comments

@juusee
Copy link

juusee commented Mar 8, 2019

Tested in Firefox 63.0.3.

Settings styles this way in function onloadFunc won't work:

if (svg) {
   svg.setAttribute("aria-hidden", "true");
   svg.style.position = "absolute";
   svg.style.width = 0;
   svg.style.height = 0;
   svg.style.overflow = "hidden";
   body.insertBefore(svg, body.firstChild);
}

Function insertBefore drops the styles from the element so to apply styles for this element they have to be set after inserting the element in dom:

if (svg) {
   svg.setAttribute("aria-hidden", "true");
   var insertedSvg = body.insertBefore(svg, body.firstChild);
   insertedSvg.style.position = "absolute";
   insertedSvg.style.width = 0;
   insertedSvg.style.height = 0;
   insertedSvg.style.overflow = "hidden";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant