Setting maxHeight on overlay with flexibleConnectedTo strategy does not work, when viewport margin is also configured
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 91
Descripción
#### Reproduction
Steps to reproduce:
1. Visit the [stackblitz](https://stackblitz.com/edit/understanding-overlay-03-viewport-margin-bug)
2. 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
```typescript
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',
});
```
Guía de contribución
Línea de trabajo
Comienza con la reproducción vinculada de StackBlitz y el ejemplo de overlay.create que usa flexibleConnectedTo, withViewportMargin(10) y maxHeight. Traza cómo el posicionamiento conectado flexible gestiona el margen del viewport y verifica la corrección con ambos botones, asegurándote de que se respete la altura máxima de 300px en cada caso.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, typescript
- Área
- frontend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100