Skip to content

Commit a7ee096

Browse files
committed
feat(ClickOutside): Only close on click when the mousedown was not inside the monitored element quasarframework#5791
1 parent af948ee commit a7ee096

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/src/components/menu/ClickOutside.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default {
7676

7777
if (handlers.click.length === 0) {
7878
// use click to be able to prevent click in handler
79-
document.addEventListener('click', globalHandler, notPassiveCapture)
79+
document.addEventListener('mousedown', globalHandler, notPassiveCapture)
8080
document.addEventListener('touchstart', globalHandler, notPassiveCapture)
8181
document.addEventListener('focusin', globalHandler, passiveCapture)
8282
}
@@ -113,7 +113,7 @@ export default {
113113

114114
if (handlers.click.length === 0) {
115115
clearTimeout(timer)
116-
document.removeEventListener('click', globalHandler, notPassiveCapture)
116+
document.removeEventListener('mousedown', globalHandler, notPassiveCapture)
117117
document.removeEventListener('touchstart', globalHandler, notPassiveCapture)
118118
document.removeEventListener('focusin', globalHandler, passiveCapture)
119119
}

0 commit comments

Comments
 (0)