Skip to content

Some inline SVGs not rendering in IE 11 #7358

Closed
@rob-johansen

Description

@rob-johansen

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:

alert-visible

But it's missing with the new React:

alert-invisible

With the old React, here's how the SVG element for this alert icon appears in the HTML:

<svg class="input-error-icon" height="19px" width="19px" viewBox="0 0 19 19">
    <defs>
        <path id="0bbd0228-d6c1-4512-9605-3d9b65764f92" d="M6.64416569,0.289011525 C6.82060206,-0.0872301213 7.12227501,-0.098498378 7.32083768,0.269150816 L14.9195766,14.3386147 C15.1168558,14.7038876 14.937946,14.9999998 14.5276777,14.9999998 L0.494636005,15 C0.0809170107,15 -0.110284206,14.6925343 0.0649978173,14.3187542 L6.64416569,0.289011525 Z"></path>
        <mask id="5867705e-d384-40b8-8cef-d12afb961468" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="-2" y="-2" width="19" height="19">
            <rect x="-2" y="-2" width="19" height="19" fill="white"></rect>
            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#0bbd0228-d6c1-4512-9605-3d9b65764f92" fill="black"></use>
        </mask>
    </defs>
    <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g transform="translate(-816.000000, -510.000000)">
            <g transform="translate(376.000000, 223.000000)">
                <g transform="translate(0.000000, 97.000000)">
                    <g transform="translate(11.000000, 110.000000)">
                        <g transform="translate(2.000000, 58.000000)">
                            <g transform="translate(276.000000, 10.000000)">
                                <g transform="translate(0.000000, 11.000000)">
                                    <g transform="translate(150.000000, 0.000000)">
                                        <g transform="translate(3.000000, 3.000000)">
                                            <use stroke="#ce0000" mask="url(#5867705e-d384-40b8-8cef-d12afb961468)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#0bbd0228-d6c1-4512-9605-3d9b65764f92"></use>
                                            <path d="M7,6 L7,10.0000001" stroke="#ce0000" stroke-width="2" stroke-linecap="round"></path>
                                            <circle fill="#ce0000" cx="7" cy="13" r="1"></circle>
                                        </g>
                                    </g>
                                </g>
                            </g>
                        </g>
                    </g>
                </g>
            </g>
        </g>
    </g>
</svg>

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):

<svg class="input-error-icon" height="19px" width="19px" viewBox="0 0 19 19">
    <defs>
        <path id="0bbd0228-d6c1-4512-9605-3d9b65764f92" d="M6.64416569,0.289011525 C6.82060206,-0.0872301213 7.12227501,-0.098498378 7.32083768,0.269150816 L14.9195766,14.3386147 C15.1168558,14.7038876 14.937946,14.9999998 14.5276777,14.9999998 L0.494636005,15 C0.0809170107,15 -0.110284206,14.6925343 0.0649978173,14.3187542 L6.64416569,0.289011525 Z"></path>
        <mask id="5867705e-d384-40b8-8cef-d12afb961468" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="-2" y="-2" width="19" height="19">
            <rect x="-2" y="-2" width="19" height="19" fill="white"></rect>
            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#0bbd0228-d6c1-4512-9605-3d9b65764f92" fill="black"></use>
        </mask>
    </defs>
</svg>

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions