Skip to content

Commit 62d75d5

Browse files
committed
Update closeOnClickOutside to ignore cases where ev.clientX/Y is undefined or 0
1 parent ae4b0a9 commit 62d75d5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

ui/main.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ const App = () => {
130130
}, { current: document.body })
131131

132132
const closeOnClickOutside = (ev: JSXInternal.TargetedMouseEvent<HTMLDialogElement>) => {
133+
if (/* undefined or 0 */!ev.clientX || !ev.clientY) { return }
133134
const rect = ev.currentTarget.getBoundingClientRect()
134135
if (rect.left <= ev.clientX && ev.clientX < rect.right &&
135136
rect.top <= ev.clientY && ev.clientY < rect.bottom) { return }

0 commit comments

Comments
 (0)