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

Add missing onAnimationStart/onAnimationEnd event handlers #1196

Closed
tichris0 opened this issue Feb 27, 2014 · 5 comments
Closed

Add missing onAnimationStart/onAnimationEnd event handlers #1196

tichris0 opened this issue Feb 27, 2014 · 5 comments

Comments

@tichris0
Copy link

React currently doesn't handle the aforementioned 2 events. I have a patch that works for webkit only; but more work needs to be done to make it work under all browsers until they support the standard CSS tags.

@zpao
Copy link
Member

zpao commented Feb 28, 2014

Take a look at https://github.com/facebook/react/blob/master/src/addons/transitions/ReactTransitionEvents.js which is currently listening for the right events.

@tichris0
Copy link
Author

Yah: I've seen that file before. To be clear; are you suggesting that I use that strategy to handle multiple browsers or to use that component directly?

@gasi
Copy link
Contributor

gasi commented Apr 21, 2014

👍 to add native support for onAnimationEnd 😄

@tichris0: In the meantime, I solved it as follows:

TransitionEvents = require 'react/lib/ReactTransitionEvents'

module.exports = React.createClass
    displayName: 'Component'

    # ...

    componentDidMount: ->
        # HACK: Manually support `animationEnd` event
        # See: http://git.io/dfdd1Q
        if @props.onAnimationEnd
            TransitionEvents.addEndEventListener @getDOMNode(),
                @props.onAnimationEnd

   render: ->
      # ...

# Invoke as follows:
Component
  onAnimationEnd: @handleAnimationEnd
  # ...

@ghost
Copy link

ghost commented Mar 3, 2016

Hi, would love a status update on this, any targeted fix version or date?

@gaearon
Copy link
Collaborator

gaearon commented Mar 3, 2016

The support for them was merged into master in #6005 a few days ago.
It should be included in v15 RC that’s going to be released very soon.

Stay tuned!

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

6 participants