Skip to content

Commit db5bb1b

Browse files
authored
fix popover placement for placement="start"|"end" (#5137)
1 parent 0fe0199 commit db5bb1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@react-aria/overlays/src/calculatePosition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function getDelta(
145145
) {
146146
let root = document.scrollingElement || document.documentElement;
147147
let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
148-
let containerScroll = isScrollPrevented ? 0 : containerDimensions.scroll[axis];
148+
let containerScroll = isScrollPrevented && (axis === 'left' || axis === 'right') ? 0 : containerDimensions.scroll[axis];
149149
let containerHeight = containerDimensions[AXIS_SIZE[axis]];
150150

151151
let startEdgeOffset = offset - padding - containerScroll;

0 commit comments

Comments
 (0)