Skip to content

Commit 6ccd39e

Browse files
authored
Instance check instead of cast (#3379)
Instance check instead of cast.
1 parent f31e726 commit 6ccd39e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/frontend/src/lib/components/ui/Popover.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@
108108
onintrostart={() => popoverRef?.showPopover()}
109109
onoutrostart={() => popoverRef?.hidePopover()}
110110
onfocusout={(e) => {
111-
if (!popoverRef?.contains(e.relatedTarget as Node)) {
111+
if (
112+
!(e.relatedTarget instanceof Node) ||
113+
!popoverRef?.contains(e.relatedTarget)
114+
) {
112115
anchorRef?.querySelector("button")?.focus();
113116
onClose?.();
114117
}

0 commit comments

Comments
 (0)