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
It is because IE does not support innerHTML for svg elements
I've fixed it like this on my end using :transform-source. You could use it as a fix.
transformSource(svg) {
if (!environment.isIE()) {
return svg
}
//InlineSvg component is based on innerHTML
//and IE11 does not set innerHTML for svg initially
const serializer = new XMLSerializer()
const svgContent = Array.prototype.map.call(
svg.childNodes,
(child) => serializer.serializeToString(child)
).join("")
svg.innerHTML = svgContent
return svg
}
The text was updated successfully, but these errors were encountered:
ElVisPL
changed the title
InlineSvg does not work for IE11
InlineSvg does not work on IE11
Jan 13, 2020
As suggested by @shrpne, using a polyfill allows this to be used in IE11. However, I have come across another issue.
When using this with a webpack configuration which uses url-loader to load the SVG files (in my case Nuxt), and the SVG is below the limit to transform the file into base64, IE will fail to load the file with an Access Denied error.
A fix for this is to use the Webpack Inline Loader configuration to force the use of a different loader or loader config which prevents the base64 conversion, e.g.
It is because IE does not support
innerHTML
for svg elementsI've fixed it like this on my end using
:transform-source
. You could use it as a fix.The text was updated successfully, but these errors were encountered: