Skip to content
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

SVG image onLoad event not getting dispatched on IE11 #11058

Closed
SahidH opened this issue Oct 3, 2017 · 5 comments
Closed

SVG image onLoad event not getting dispatched on IE11 #11058

SahidH opened this issue Oct 3, 2017 · 5 comments

Comments

@SahidH
Copy link

SahidH commented Oct 3, 2017

SVG image element is not getting onLoad event dispatched on IE11

Example:
https://codepen.io/sahid/pen/NaaRzX

Tested with React 15.1 and 16.0

@jquense
Copy link
Contributor

jquense commented Oct 3, 2017

I am not sure what's going on here, but some research suggests there are a few oddities on the IE11 image tag. Practically I cannot get the onLoad event to work at all in js in IE11 (see codepen). Adding an inline onload="alert('here')" in plain markup does work but that's all I've been able to get to work.

There a scant fixes i could find online and the one here is supppper ugly and probably not tenable. Any insight @nhunzaker ? you are the resident svg guru

@gaearon gaearon changed the title [Bug] onLoad event not getting dispatched on IE11 SVG image onLoad event not getting dispatched on IE11 Oct 3, 2017
@nhunzaker
Copy link
Contributor

Gah, Sorry! I'm just getting to this doing some testing for another PR and I stumbled upon this via Google 😵.

I can't get IE or Edge to load the SVG image event, period using the following test:
https://codepen.io/nhunzaker/pen/babXLO

I can't find a solution researching (googling) online either, other than the recommendation you've suggested to use a new Image() proxy.

I'd be comfortable closing this one out and writing it off as a browser bug. It's lame, but I'm not super into hacking an image tag into SVG (and worried about edge cases if used as a general solution)

@gaearon, @jquense what do you think?

@jquense
Copy link
Contributor

jquense commented Dec 12, 2017

yeah I think the cost of the workaround is too much. I'm comfortable with this being a "won't fix" if ya'll are

@nhunzaker
Copy link
Contributor

I'm okay with that.

@SahidH
Copy link
Author

SahidH commented Dec 12, 2017

Indeed @nhunzaker Image class was the workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants