Skip to content

Commit 35bc27b

Browse files
committed
fix scrolled case
1 parent 4097f3c commit 35bc27b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,14 +301,14 @@ function getMaxHeight(
301301
let maxHeight = heightGrowthDirection !== 'top' ?
302302
// We want the distance between the top of the overlay to the bottom of the boundary
303303
Math.max(0,
304-
(boundaryDimensions.height + boundaryDimensions.top + (boundaryDimensions.scroll.top ?? 0)) // this is the bottom of the boundary
304+
(boundaryDimensions.height + boundaryDimensions.top) // this is the bottom of the boundary
305305
- overlayTop // this is the top of the overlay
306306
- ((margins.top ?? 0) + (margins.bottom ?? 0) + padding) // save additional space for margin and padding
307307
)
308308
// We want the distance between the bottom of the overlay to the top of the boundary
309309
: Math.max(0,
310310
(overlayTop + overlayHeight) // this is the bottom of the overlay
311-
- (boundaryDimensions.top + (boundaryDimensions.scroll.top ?? 0)) // this is the top of the boundary
311+
- boundaryDimensions.top // this is the top of the boundary
312312
- ((margins.top ?? 0) + (margins.bottom ?? 0) + padding) // save additional space for margin and padding
313313
);
314314
return Math.min(boundaryDimensions.height - (padding * 2), maxHeight);

0 commit comments

Comments
 (0)