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

Missing onLoad and onError events on SVG <image> tag #5626

Closed
tombigel opened this issue Dec 8, 2015 · 13 comments
Closed

Missing onLoad and onError events on SVG <image> tag #5626

tombigel opened this issue Dec 8, 2015 · 13 comments

Comments

@tombigel
Copy link

tombigel commented Dec 8, 2015

SVG <image> is supposed as far as I know to support at least the same onload and onerror events <img> supports.

From looking at React code the events are handled on specific elements in ReactDOMComponents.js in trapBubbledEventsLocal, mountComponent, unmountComponent.

It would be easy to create a pull request to add 'image' to these cases, but it seems that there is a separation between js files that handle DOM and SVG in the codebase that this might collide with.

Am I correct and there is more to it than just adding more cases? Or these functions are the right place to also handle SVG image?

@savelichalex
Copy link

+1 to add this handler

@niwinz
Copy link

niwinz commented Feb 27, 2016

+1

1 similar comment
@shalanah
Copy link

shalanah commented Nov 7, 2016

+1

@gaearon
Copy link
Collaborator

gaearon commented Nov 8, 2016

If you’re interested in this, could you please send a PR? Yes I think ReactDOMComponent.js is the right place for this.

@Flaque
Copy link

Flaque commented May 5, 2017

@gaearon I'm gonna try this.

Simek added a commit to Simek/react that referenced this issue May 7, 2017
simple fix + test, but still few other SVG events are missing
@Simek
Copy link
Contributor

Simek commented May 7, 2017

I've commited PR which adds onLoad and onError events to SVG, but we are still missing few others like onUnload, onResize, onScroll, onZoom etc. Thank you @gaearon for mentioning correct file name.

@mdogadailo
Copy link
Contributor

<image /> load and error events were fixes here #9042

@zabojad
Copy link

zabojad commented Jun 12, 2017

@mdogadailo that doesn't seem to have affected <svg /> load and error events...

@mdogadailo
Copy link
Contributor

mdogadailo commented Jun 12, 2017

@zabojad yes, but this ticket about <image /> tag, not about <svg /> element like in #9607

@aweary
Copy link
Contributor

aweary commented Sep 20, 2017

This was resolved by #9042 🍾

@aweary aweary closed this as completed Sep 20, 2017
@SahidH
Copy link

SahidH commented Oct 2, 2017

@aweary seems that onLoad event is not getting dispatched on IE11 (it is supported)

@gaearon
Copy link
Collaborator

gaearon commented Oct 3, 2017

(Let's track that in #11058)

@michalpuskel
Copy link

michalpuskel commented May 18, 2023

+1
<svg /> onLoad is still not working [on React 17]

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

No branches or pull requests