-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Added support for synthetic animation/transition events. #6005
Conversation
/** | ||
* Element to check for prefixes on. | ||
*/ | ||
var style = document.createElement('div').style; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be guarded in a canUseDOM
check.
@milesj updated the pull request. |
@zpao Updated based on comments. |
Would be cool if this made it into v15 👍 |
nativeEvent, | ||
nativeEventTarget | ||
) { | ||
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SyntheticEvent constructor has to return this
explicitly now.
#5947
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the heads up.
@milesj updated the pull request. |
prefixes['Webkit' + styleProp] = 'webkit' + eventName; | ||
prefixes['Moz' + styleProp] = 'moz' + eventName; | ||
prefixes['ms' + styleProp] = 'MS' + eventName; | ||
prefixes['O' + styleProp] = 'o' + eventName + ' o' + eventName.toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right. Why do we have a space separated value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, nice catch, that's left over from old jQuery code I copied. It was there because different versions of Opera supported either otransitionend
or oTransitionEnd
and jQuery allowed binding multiple events via spaces. The lowercase one is the latest, so I will update to use that.
@milesj updated the pull request. |
prefixes['Webkit' + styleProp] = 'webkit' + eventName; | ||
prefixes['Moz' + styleProp] = 'moz' + eventName; | ||
prefixes['ms' + styleProp] = 'MS' + eventName; | ||
prefixes['O' + styleProp] = 'o' + eventName.toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth noting that this is different than what we were doing (oTransitionEnd
) but looking around the web, that should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it was hard to tell. Would be nice if there was a table of all the browsers, their versions, and what prefixes are used.
Thanks! Let's do it and thanks for sticking with it! |
Added support for synthetic animation/transition events.
Awesome, thanks for the input and accepting the PR! |
As the title states.
This is a recreation of #5835 as my branch got foobar'd.
I tested this using a real code base here: https://github.com/titon/toolkit/blob/3.0/src/components/carousel/ItemList.js#L210