diff options
| author | XhmikosR <[email protected]> | 2022-09-07 18:31:39 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-09-07 18:31:39 +0300 |
| commit | 23e50829f958ea1d741d63e2781716be037e4644 (patch) | |
| tree | 8ebbded3408c0ca80bba63f755f45f3c9cb71780 /js/dist/modal.js | |
| parent | 23fb7a79156d1ea4ce2ab5713debbbc251b4e22f (diff) | |
| download | bootstrap-23e50829f958ea1d741d63e2781716be037e4644.tar.xz bootstrap-23e50829f958ea1d741d63e2781716be037e4644.zip | |
Release v5.2.1 (#37098)
* Bump version to v5.2.1.
* Dist
Diffstat (limited to 'js/dist/modal.js')
| -rw-r--r-- | js/dist/modal.js | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/js/dist/modal.js b/js/dist/modal.js index b27d6ab38..34aea5482 100644 --- a/js/dist/modal.js +++ b/js/dist/modal.js @@ -1,5 +1,5 @@ /*! - * Bootstrap modal.js v5.2.0 (https://getbootstrap.com/) + * Bootstrap modal.js v5.2.1 (https://getbootstrap.com/) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ @@ -20,7 +20,7 @@ /** * -------------------------------------------------------------------------- - * Bootstrap (v5.2.0): modal.js + * Bootstrap (v5.2.1): modal.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ @@ -39,6 +39,7 @@ const EVENT_SHOW = `show${EVENT_KEY}`; const EVENT_SHOWN = `shown${EVENT_KEY}`; const EVENT_RESIZE = `resize${EVENT_KEY}`; + const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`; const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`; const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`; const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`; @@ -231,20 +232,22 @@ } }); EventHandler__default.default.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => { - if (event.target !== event.currentTarget) { - // click is inside modal-dialog - return; - } + EventHandler__default.default.one(this._element, EVENT_CLICK_DISMISS, event2 => { + // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks + if (this._dialog.contains(event.target) || this._dialog.contains(event2.target)) { + return; + } - if (this._config.backdrop === 'static') { - this._triggerBackdropTransition(); + if (this._config.backdrop === 'static') { + this._triggerBackdropTransition(); - return; - } + return; + } - if (this._config.backdrop) { - this.hide(); - } + if (this._config.backdrop) { + this.hide(); + } + }); }); } |
