aboutsummaryrefslogtreecommitdiff
path: root/js/src/modal.js
diff options
context:
space:
mode:
authorJérémie Broutier <[email protected]>2022-09-15 12:30:51 +0200
committerGitHub <[email protected]>2022-09-15 13:30:51 +0300
commit6f65df4faea2694840572626f8a02f4399bd0dca (patch)
tree695bdd7d992748fc94c80ba6bd7f7331b1270228 /js/src/modal.js
parentaedd7fb9de38efbf6bb4a5443aa870d814df8c55 (diff)
downloadbootstrap-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/modal.js')
-rw-r--r--js/src/modal.js4
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
}