question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Raw svg doesn't seem to work in internet explorer

See original GitHub issue

Vue 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:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Justineocommented, May 7, 2017

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.

2reactions
Kansulercommented, May 5, 2017

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found