We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb5e243 commit 8a8bd38Copy full SHA for 8a8bd38
1 file changed
src/components/Dialog/hooks/usePopoverPosition.ts
@@ -10,6 +10,8 @@ import {
10
} from '@floating-ui/react';
11
import type { AutoPlacementOptions } from '@floating-ui/core';
12
13
+const hasResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window;
14
+
15
export type PopperLikePlacement = Placement | 'auto' | 'auto-start' | 'auto-end';
16
17
function autoMiddlewareFor(p: PopperLikePlacement) {
@@ -98,7 +100,7 @@ export function usePopoverPosition({
98
100
ancestorResize: true,
99
101
ancestorScroll: true,
102
animationFrame: false,
- elementResize: true,
103
+ elementResize: hasResizeObserver,
104
...autoUpdateOptions,
105
}),
106
});
0 commit comments