diff options
| author | Jérémie Broutier <[email protected]> | 2022-09-15 12:30:51 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-09-15 13:30:51 +0300 |
| commit | 6f65df4faea2694840572626f8a02f4399bd0dca (patch) | |
| tree | 695bdd7d992748fc94c80ba6bd7f7331b1270228 /js/src | |
| parent | aedd7fb9de38efbf6bb4a5443aa870d814df8c55 (diff) | |
| download | bootstrap-6f65df4faea2694840572626f8a02f4399bd0dca.tar.xz bootstrap-6f65df4faea2694840572626f8a02f4399bd0dca.zip | |
Fix modal event listeners (#37128)
* Fix modal event listeners (#37126)
Co-authored-by: GeoSot <[email protected]>
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/modal.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/src/modal.js b/js/src/modal.js index c97722538..a39597b3a 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -223,9 +223,9 @@ class Modal extends BaseComponent { }) EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => { + // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks EventHandler.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)) { + if (this._element !== event.target || this._element !== event2.target) { return } |
