Skip to content

Commit 0a28394

Browse files
authored
feat(ClickOutside): do not close menus opened below non-seamless dialogs on pointer interaction in dialog (quasarframework#8046)
1 parent c3b0b06 commit 0a28394

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ui/src/components/dialog/QDialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export default Vue.extend({
334334

335335
__renderPortal (h) {
336336
return h('div', {
337-
staticClass: 'q-dialog fullscreen no-pointer-events',
337+
staticClass: 'q-dialog fullscreen no-pointer-events ' + (this.useBackdrop === true ? 'q-dialog--modal' : 'q-dialog--seamless'),
338338
class: this.contentClass,
339339
style: this.contentStyle,
340340
attrs: this.qAttrs

ui/src/components/menu/ClickOutside.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ const
1010
focus: []
1111
}
1212

13+
function hasModalsAbove (node) {
14+
while ((node = node.nextElementSibling) !== null) {
15+
if (node.classList.contains('q-dialog--modal')) {
16+
return true
17+
}
18+
}
19+
20+
return false
21+
}
22+
1323
function execHandlers (list, evt) {
1424
for (let i = list.length - 1; i >= 0; i--) {
1525
if (list[i](evt) === void 0) {
@@ -51,6 +61,7 @@ export default {
5161
// directives that prevent click by using pointer-events none generate click on html element
5262
target !== document.documentElement &&
5363
target.classList.contains('no-pointer-events') === false &&
64+
hasModalsAbove(el) !== true &&
5465
(
5566
ctx.toggleEl === void 0 ||
5667
ctx.toggleEl.contains(target) === false

0 commit comments

Comments
 (0)