fix: false positives for dialog backdrop click when noFrame
Massimo Melina committed
Jun 16, 2023 at 01:24 UTC
902a1205d41a4f591c235378c4ab279b95c5b4d0
1 file changed
+3
-1
shared/dialogs.ts
+3
-1
@@ -49,7 +49,9 @@ function Dialog(d:DialogOptions) {
49
className: 'dialog-backdrop '+(d.className||''),
50
tabIndex: 0,
51
onKeyDown,
52
- onClick: ()=> closeDialog()
52
+ onClick: (ev: any) =>
53
+ ev.target === ev.currentTarget // this test will tell us if really the backdrop was clicked
54
+ && closeDialog()
55
},
56
d.noFrame ? h(d.Content || 'div')
57
: h('div', {