Raw svg doesn't seem to work in internet explorer
See original GitHub issueVue Version: 2.3.0 Vue-awesome Version: 2.3.0
It seems like if you register a raw svg it doesn’t work in Internet Explorer 11 and below, not sure about Edge.
Icon.register({
sweden: {
width: 300,
height: 150,
raw: '<rect width="300" height="150" fill="#006aa7"></rect><rect width="30" height="150" x="100" fill="#fecc00"></rect><rect width="300" height="30" y="60" fill="#fecc00"></rect>'
}
})
In <IE11 the paths will be empty, while in Chrome and Firefox it works fine. IE:
<svg xmlns="http://www.w3.org/2000/svg" class="flag-icon fa-icon" role="presentation" viewBox="0 0 300 150" width="16" height="8" data-v-4d200f48="" version="1.1">
<g />
</svg>
Chrome:
<svg data-v-4d200f48="" version="1.1" role="presentation" width="16" height="8" viewBox="0 0 300 150" class="flag-icon fa-icon">
<g>
<rect width="300" height="150" fill="#006aa7"></rect><rect width="30" height="150" x="100" fill="#fecc00"></rect><rect width="300" height="30" y="60" fill="#fecc00"></rect>
</g>
</svg>
If I with the DOM explorer parse the paths right into the <svg/> element it displays correctly.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
SVG not rendering IE 11 - Stack Overflow
I had a similar issue and in my case it was because IE requires the viewBox attribute to be specified within the SVG...
Read more >Fix SVGs not scaling in IE9, IE10, and IE11 - Github-Gist
IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox , width and height attributes are specified. View...
Read more >Scalable Vector Graphics (SVG) files are displayed incorrectly ...
Fixes an issue in which Scalable Vector Graphics (SVG) files are displayed incorrectly in Internet Explorer 11. This issue occurs because seam mitigation...
Read more >Why text in exported SVG images may not display correctly
When you look at a diagram exported to an SVG image in IE or some SVG editors, the text may not display correctly....
Read more >Probably Don't Base64 SVG | CSS-Tricks
Anyway, maybe this is all super obvious. But it just seems to me if you're going to use a data URI for SVG...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t think it’s a good practice to include a polyfill in a component. Maybe users should include the polyfill themselves if they decide to use
raw
feature and we can clarify that in the docs.Ah, so that’s the reason why. I believe that this still is a good feature to have. I found a solution that uses innersvg-polyfill and just make an import statement with it. That solved the issue!