You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a problem if you are switching svg files dynamically. Without the full path, IE keep referencing the previous file. I run into this problem because we have icon sprite sheets for multiple sizes and #id points to multiple matches as I switch around sprite sheets.
I have:
icons.svg
/24/icons.svg
/48/icons.svg
All of them have the same set of icons (same id's) but the larger icons have more detail. if I swap the url in the xlink:href using JavaScript, I end up rendering the wrong svg because svgxuse.js trims everything but the #.
The text was updated successfully, but these errors were encountered:
This isn't inherently a bug this is how the library operates. It replaces the href because the svg is attached to the current body so it only needs the #id to reference it.
If you want to dynamically switch you will have to insert the whole path again. And then if it fails to load in IE11 the library will attach the new svg to the body again and change the href to only an #id again.
Not sure how good the last part works of it watching for the change of a href.
In IE 11, when using svgxuse.js I noticed that my xlink:href value in the source code is not the same as what renders in the DOM.
turns out like this:
This is a problem if you are switching svg files dynamically. Without the full path, IE keep referencing the previous file. I run into this problem because we have icon sprite sheets for multiple sizes and #id points to multiple matches as I switch around sprite sheets.
I have:
icons.svg
/24/icons.svg
/48/icons.svg
All of them have the same set of icons (same id's) but the larger icons have more detail. if I swap the url in the xlink:href using JavaScript, I end up rendering the wrong svg because svgxuse.js trims everything but the #.
The text was updated successfully, but these errors were encountered: