Skip to content

Commit acaad76

Browse files
chore: check if there is an opener
1 parent c645db0 commit acaad76

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/main/src/PopoverResize.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,12 @@ class PopoverResize {
119119
const isRtl = popover.isRtl;
120120

121121
const opener = popover.getOpenerHTMLElement(popover.opener);
122-
const openerRect = opener!.getBoundingClientRect();
122+
123+
if (!opener) {
124+
return ResizeHandlePlacement.BottomRight;
125+
}
126+
127+
const openerRect = opener.getBoundingClientRect();
123128
const popoverWrapperRect = popover.getBoundingClientRect();
124129

125130
let openerCX = Math.floor(openerRect.x + openerRect.width / 2);

0 commit comments

Comments
 (0)