Open
Description
Reproduction
Steps to reproduce:
- Visit the stackblitz
- Click the 2 buttons
Expected Behavior
That the max height of 300px is respected in both cases
Actual Behavior
Max height is only respected, if withViewportMargin(10)
is not configured.
Environment
- Angular: 8.2.13
- CDK/Material: 8.2.3
- Browser(s):
Version 78.0.3904.70 (Official Build) (64-bit)
- Operating System (e.g. Windows, macOS, Ubuntu):
macOS Mojave
Gif
Relevant code
const overlayRef = this.overlay.create({
hasBackdrop: true,
positionStrategy: this.overlay.position().flexibleConnectedTo(element)
// The max height is only respected, if the viewport margin is left out
.withViewportMargin(10) // <------
.withPositions([
{
originX: 'end',
originY: 'bottom',
overlayX: 'end',
overlayY: 'top',
},
]),
width: '200px',
maxHeight: '300px',
});