Skip to content

Commit 8ffa764

Browse files
committed
Maybe more accurate fractional height
1 parent 5420894 commit 8ffa764

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/@react-spectrum/overlays/src/Underlay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function Underlay({isOpen, isTransparent, ...otherProps}: UnderlayProps):
2525
if (typeof document !== 'undefined') {
2626
let scrollingElement = isScrollable(document.body) ? document.body : document.scrollingElement || document.documentElement;
2727
// Prevent Firefox from adding scrollbars when the page has a fractional height.
28-
let fractionalHeightDifference = scrollingElement.clientHeight - scrollingElement.getBoundingClientRect().height;
28+
let fractionalHeightDifference = scrollingElement.getBoundingClientRect().height % 1;
2929
pageHeight = scrollingElement.scrollHeight - fractionalHeightDifference;
3030
}
3131

packages/react-aria-components/src/Modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function ModalOverlayInner({UNSTABLE_portalContainer, ...props}: ModalOverlayInn
175175
if (typeof document !== 'undefined') {
176176
let scrollingElement = isScrollable(document.body) ? document.body : document.scrollingElement || document.documentElement;
177177
// Prevent Firefox from adding scrollbars when the page has a fractional height.
178-
let fractionalHeightDifference = scrollingElement.clientHeight - scrollingElement.getBoundingClientRect().height;
178+
let fractionalHeightDifference = scrollingElement.getBoundingClientRect().height % 1;
179179
pageHeight = scrollingElement.scrollHeight - fractionalHeightDifference;
180180
}
181181

0 commit comments

Comments
 (0)