We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c8e14b commit dc6a91cCopy full SHA for dc6a91c
app/app.vue
@@ -74,6 +74,14 @@ function handleGlobalKeyup() {
74
function handleModalLightDismiss(e: MouseEvent) {
75
const target = e.target as HTMLElement
76
if (target.tagName === 'DIALOG' && target.hasAttribute('open')) {
77
+ const rect = target.getBoundingClientRect()
78
+ const isOutside =
79
+ e.clientX < rect.left ||
80
+ e.clientX > rect.right ||
81
+ e.clientY < rect.top ||
82
+ e.clientY > rect.bottom
83
+
84
+ if (!isOutside) return
85
;(target as HTMLDialogElement).close()
86
}
87
0 commit comments