mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-28 14:29:07 +02:00
Fix handling of transitionend events dispatched by nested elements(#33845)
Fix handling of transitionend events dispatched by nested elements Properly handle events from nested elements Change `emulateTransitionEnd` to `executeAfterTransition` &&
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import EventHandler from '../dom/event-handler'
|
||||
import { emulateTransitionEnd, execute, getElement, getTransitionDurationFromElement, reflow, typeCheckConfig } from './index'
|
||||
import { execute, executeAfterTransition, getElement, reflow, typeCheckConfig } from './index'
|
||||
|
||||
const Default = {
|
||||
isVisible: true, // if false, we use the backdrop helper without adding any element to the dom
|
||||
@@ -122,14 +122,7 @@ class Backdrop {
|
||||
}
|
||||
|
||||
_emulateAnimation(callback) {
|
||||
if (!this._config.isAnimated) {
|
||||
execute(callback)
|
||||
return
|
||||
}
|
||||
|
||||
const backdropTransitionDuration = getTransitionDurationFromElement(this._getElement())
|
||||
EventHandler.one(this._getElement(), 'transitionend', () => execute(callback))
|
||||
emulateTransitionEnd(this._getElement(), backdropTransitionDuration)
|
||||
executeAfterTransition(callback, this._getElement(), this._config.isAnimated)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user