File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -926,6 +926,7 @@ export class FlexibleConnectedPositionStrategy implements PositionStrategy {
926926 right : '' ,
927927 position : '' ,
928928 transform : '' ,
929+ maxHeight : '' ,
929930 } as CSSStyleDeclaration ) ;
930931 }
931932
@@ -1004,13 +1005,17 @@ export class FlexibleConnectedPositionStrategy implements PositionStrategy {
10041005
10051006 // We want to set either `top` or `bottom` based on whether the overlay wants to appear
10061007 // above or below the origin and the direction in which the element will expand.
1008+ const documentHeight = this . _document . documentElement ! . clientHeight ;
10071009 if ( position . overlayY === 'bottom' ) {
10081010 // When using `bottom`, we adjust the y position such that it is the distance
10091011 // from the bottom of the viewport rather than the top.
1010- const documentHeight = this . _document . documentElement ! . clientHeight ;
10111012 styles . bottom = `${ documentHeight - ( overlayPoint . y + this . _overlayRect . height ) } px` ;
1013+ styles . maxHeight = `${ overlayPoint . y + this . _overlayRect . height + scrollPosition . top } px` ;
10121014 } else {
1015+ const remainingScroll =
1016+ this . _document . documentElement ! . scrollHeight - documentHeight - scrollPosition . top ;
10131017 styles . top = coerceCssPixelValue ( overlayPoint . y ) ;
1018+ styles . maxHeight = `${ documentHeight - overlayPoint . y + remainingScroll } px` ;
10141019 }
10151020
10161021 return styles ;
You can’t perform that action at this time.
0 commit comments