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

support onLoad synthetic event attribute on 'object' tags #5781

Merged
merged 1 commit into from
Mar 7, 2016

Conversation

ara4n
Copy link
Contributor

@ara4n ara4n commented Jan 5, 2016

It seems like a bug that onLoad attributes are ignored on 'object' tags - this fixes it by cargoculting the 'iframe' tag example. This is useful for telling when SVGs have loaded when SVGs are embedded as objects (such that the SVG can be dynamically edited from JS).

…r telling when SVGs embedded as objects have loaded
@syranide
Copy link
Contributor

syranide commented Jan 5, 2016

I'm curious; should this apply to <embed> as well perhaps? What about the error-event?

@ara4n
Copy link
Contributor Author

ara4n commented Jan 6, 2016

yup, <embed> should probably also fire onLoad, and yup, they should probably also both fire onError too (although from looking at the event inspector in Chrome, it seemed that React had already installed an error listener for <object>). I guess I wanted to check that this is the right approach before extending it to too many other missing tags & events...

@facebook-github-bot
Copy link

@ara4n updated the pull request.

@zpao zpao added this to the 15.0 milestone Feb 29, 2016
@zpao
Copy link
Member

zpao commented Mar 7, 2016

I've been playing around with this a bit and I can't get error events out of object elements, nor can I get load (or error) events out of embeds. Also, gets a bit tricky since the load event doesn't even fire consistently (can get it for SVGs but not others). I think this is probably fine pretty much as is. And if we need to we can always follow up. I'll give it a bit of a closer look shortly and merge tonight. Thanks (and sorry for the delay!)

zpao added a commit that referenced this pull request Mar 7, 2016
support onLoad synthetic event attribute on 'object' tags
@zpao zpao merged commit f3738d2 into facebook:master Mar 7, 2016
richvdh added a commit to matrix-org/matrix-react-sdk that referenced this pull request Apr 17, 2016
facebook/react#5781 has been fixed in React 15.0, so
drop our workaroud for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants