mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-07 22:26:57 +02:00
Fix prevented show event disables modals with fade class from being displayed again (#34085)
Fix modal, in case is faded, a prevented show event can cause show method to not be executed again.
This commit is contained in:
@@ -108,20 +108,20 @@ class Modal extends BaseComponent {
|
||||
return
|
||||
}
|
||||
|
||||
if (this._isAnimated()) {
|
||||
this._isTransitioning = true
|
||||
}
|
||||
|
||||
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {
|
||||
relatedTarget
|
||||
})
|
||||
|
||||
if (this._isShown || showEvent.defaultPrevented) {
|
||||
if (showEvent.defaultPrevented) {
|
||||
return
|
||||
}
|
||||
|
||||
this._isShown = true
|
||||
|
||||
if (this._isAnimated()) {
|
||||
this._isTransitioning = true
|
||||
}
|
||||
|
||||
scrollBarHide()
|
||||
|
||||
document.body.classList.add(CLASS_NAME_OPEN)
|
||||
|
Reference in New Issue
Block a user