Skip to content

Commit

Permalink
Safer check for transitionend event
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Feb 15, 2019
1 parent 59c2cdd commit eb023cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/popper.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@ export function applyTransitionDuration(els, value) {
* @param {Function} listener
*/
export function toggleTransitionEndListener(tooltip, action, listener) {
const eventName = isUCBrowser ? 'webkitTransitionEnd' : 'transitionend'
// UC Browser hasn't adopted the `transitionend` event despite supporting
// unprefixed transitions...
const eventName =
isUCBrowser && document.body.style.WebkitTransition !== undefined
? 'webkitTransitionEnd'
: 'transitionend'
tooltip[action + 'EventListener'](eventName, listener)
}

Expand Down

0 comments on commit eb023cb

Please sign in to comment.