Skip to content

Commit 9f12434

Browse files
committed
fix: typeerror cannot read properties ofundefined-reading
1 parent 3bde6f1 commit 9f12434

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/react/src/components/Popovers/GenericPopover.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export type GenericPopoverReference =
2727
cacheMountedBoundingClientRect?: boolean;
2828
}
2929
| {
30+
element: undefined;
3031
// When no reference element is provided, this can be provided as an
3132
// alternative "virtual" element to position the popover around.
3233
getBoundingClientRect: () => DOMRect;
@@ -62,7 +63,7 @@ export function getMountedBoundingClientRectCache(
6263

6364
return () => {
6465
if (
65-
"element" in reference &&
66+
reference.element &&
6667
(reference.cacheMountedBoundingClientRect ?? true)
6768
) {
6869
if (reference.element.isConnected) {

0 commit comments

Comments
 (0)