Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authoralpadev <2838324+alpadev@users.noreply.github.com>2021-07-25 20:36:11 +0300
committerGitHub <noreply@github.com>2021-07-25 20:36:11 +0300
commitb010a6f9f4ea3dda08a4792e1367730ddcf8752d (patch)
tree5b5c3138413244e028259b951de4d0128b4f0190 /js/src
parent5d24fef741944c168ad0ca9cabd1509d5803e441 (diff)
fix(modal): change the order we return from show() method (#34087)
In case of a modal with fading enabled, a prevented show event can cause show to not showing the modal anymore. See #34055 Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Diffstat (limited to 'js/src')
-rw-r--r--js/src/modal.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/src/modal.js b/js/src/modal.js
index 2e3017024e..a23bfc1ba6 100644
--- a/js/src/modal.js
+++ b/js/src/modal.js
@@ -104,22 +104,22 @@ class Modal {
return
}
- if ($(this._element).hasClass(CLASS_NAME_FADE)) {
- this._isTransitioning = true
- }
-
const showEvent = $.Event(EVENT_SHOW, {
relatedTarget
})
$(this._element).trigger(showEvent)
- if (this._isShown || showEvent.isDefaultPrevented()) {
+ if (showEvent.isDefaultPrevented()) {
return
}
this._isShown = true
+ if ($(this._element).hasClass(CLASS_NAME_FADE)) {
+ this._isTransitioning = true
+ }
+
this._checkScrollbar()
this._setScrollbar()