-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Some inline SVGs not rendering in IE 11 #7358
Comments
As a workaround, I had our UX designer create a simpler, single-path SVG for the icon. The new version of React is rendering it without problems: <svg class="input-error-icon" width="19px" height="18px" viewBox="0 0 19 18">
<path fill="#ce0000" d="M18.7,14.3L11.1,1.2c-1-1.7-3.3-1.7-4.2,0.1L0.3,14.4C-0.6,16.1,0.6,18,2.5,18h14.1C18.5,18,19.6,16,18.7,14.3z M16.6,16H2.5c-0.4,0-0.6-0.3-0.4-0.7L8.6,2.3c0.2-0.4,0.5-0.4,0.7,0l7.6,13.1C17.1,15.7,17,16,16.6,16z M10,7.1V11c0,0.6-0.4,1-1,1 s-1-0.4-1-1V7.1c0-0.6,0.4-1,1-1S10,6.6,10,7.1z M10,13.9c0,0.6-0.4,1-1,1c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1 C9.5,12.9,10,13.3,10,13.9z"></path>
</svg> I'd still like to know what's wrong with the original SVG, however, so we can avoid this problem in the future. |
What does the SVG look like in React (ie in the render method)? It looks like you might be using |
Indeed I was using
And, sure enough, it looks like Still, it's surprising that |
Oh yea, Totally agree that it's surprising. I'm guessing it's related to the way we create DOM nodes now. We do some things "more correctly" now for SVG so it could be just that this never should have worked but happened to due to some irregularity. |
Thanks for your help. I prefer less complex SVGs anyway (for other reasons, like changing fill/stroke on hover with CSS), so I think I'll continue asking our UX designer to produce these single-path SVGs going forward. |
@jp7837 thanks for following up and seeing that. We'll fix it, but not sure what @stenrap was seeing is the same thing. Definitely possible, but not clear (too much change in the upgrade range to really confirm). |
I'm in the process of upgrading a project from React 0.10.0 to 15.2.1. Strangely, some of our inline SVGs have stopped rendering in IE 11 after the upgrade. Here are before and after screenshots, as well as the SVG elements themselves.
In this example, the little red alert icon renders fine in IE 11 with the old React:
But it's missing with the new React:
With the old React, here's how the SVG element for this alert icon appears in the HTML:
And here's how it appears in the HTML with the new React (it's got the
<defs>
element, but it's missing all the<g>
elements):If you want to see these in action, put in a bogus email/password at both of the following URLs in IE 11:
Old React: https://b.socrative.com/login/teacher/
New React: https://rob.socrative.com/login/teacher/
Any ideas what could be causing this? (Note that the little "G" icon for the Google button is also an inline SVG, yet it renders fine with both versions of React.)
The text was updated successfully, but these errors were encountered: