angular / angular/components

CDK overlay auto calculate width when using ConnectedPositionStrategy

Abierto
#10,393 13 comentarios 22 reacciones 0 asignados Ver en GitHub
area: cdk/overlay feature P3
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

#### Bug, feature request, or proposal:
Feature

#### What is the expected behavior?
That i can somehow configure the popup overlay to change it width to be the same as the parent, without having to add a bunch of custom styling to my popup component.
![good](https://user-images.githubusercontent.com/1499810/37336174-de6f20a8-26b0-11e8-8924-a2df159cceaf.png)

#### What is the current behavior?
![bad](https://user-images.githubusercontent.com/1499810/37336151-cfbf6fb8-26b0-11e8-9fc4-88e4d6adff71.png)

#### What is the use-case or motivation for changing an existing behavior?
I would have to do less custom styling to get a nice dropdown

#### Is there anything else we should know?
In the screenshots we have changed the width using css, however this is suboptimal to having a responsive design, where the input can change their width all the time.
To get around the problem we have to hard-code the width of both the input and the popups, so they look to fit together.

My best suggestion would be able to do something like this:

```typescript
this.overlay.position()
.connectedTo(target, {
originY: 'bottom',
originX: 'start'
}, {
overlayY: 'top',
overlayX: 'start'
})
.immitateWidth();
```

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la API CDK overlay ConnectedPositionStrategy y reproduce el caso de ancho responsivo descrito en el issue. Se considera terminado cuando un popup conectado puede coincidir con el ancho de su elemento padre a medida que este cambia, sin aplicar estilos personalizados al componente popup; el informe no especifica ningún archivo fuente ni ninguna prueba concretos.

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
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.