Skip to content

Commit 824733a

Browse files
Apply suggestion from @Copilot
Co-authored-by: Copilot <[email protected]>
1 parent 35b0aba commit 824733a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/core/utils/get-overlay-from-stack.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export default function getOverlayFromStack(elm, options) {
1010

1111
if (elm instanceof window.Element) {
1212
const style = window.getComputedStyle(elm);
13+
const rect = elm.getBoundingClientRect();
1314
if (
14-
parseInt(style?.width, 10) >= percentWidth &&
15-
parseInt(style?.height, 10) >= percentHeight &&
15+
rect.width >= percentWidth &&
16+
rect.height >= percentHeight &&
1617
style?.getPropertyValue('pointer-events') !== 'none' &&
1718
(style?.position === 'absolute' || style?.position === 'fixed')
18-
) {
1919
return true;
2020
}
2121
}

0 commit comments

Comments
 (0)