File tree 1 file changed +6
-1
lines changed
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 {
926
926
right : '' ,
927
927
position : '' ,
928
928
transform : '' ,
929
+ maxHeight : '' ,
929
930
} as CSSStyleDeclaration ) ;
930
931
}
931
932
@@ -1004,13 +1005,17 @@ export class FlexibleConnectedPositionStrategy implements PositionStrategy {
1004
1005
1005
1006
// We want to set either `top` or `bottom` based on whether the overlay wants to appear
1006
1007
// above or below the origin and the direction in which the element will expand.
1008
+ const documentHeight = this . _document . documentElement ! . clientHeight ;
1007
1009
if ( position . overlayY === 'bottom' ) {
1008
1010
// When using `bottom`, we adjust the y position such that it is the distance
1009
1011
// from the bottom of the viewport rather than the top.
1010
- const documentHeight = this . _document . documentElement ! . clientHeight ;
1011
1012
styles . bottom = `${ documentHeight - ( overlayPoint . y + this . _overlayRect . height ) } px` ;
1013
+ styles . maxHeight = `${ overlayPoint . y + this . _overlayRect . height + scrollPosition . top } px` ;
1012
1014
} else {
1015
+ const remainingScroll =
1016
+ this . _document . documentElement ! . scrollHeight - documentHeight - scrollPosition . top ;
1013
1017
styles . top = coerceCssPixelValue ( overlayPoint . y ) ;
1018
+ styles . maxHeight = `${ documentHeight - overlayPoint . y + remainingScroll } px` ;
1014
1019
}
1015
1020
1016
1021
return styles ;
You can’t perform that action at this time.
0 commit comments