CDK overlay auto calculate width when using ConnectedPositionStrategy
- Lingua principale
- TypeScript
- Stelle
- 25k
- Fork
- 6.8k
- Merge medio
- 1g 8h
- PR unite (30g)
- 91
Descrizione
#### 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.

#### What is the current behavior?

#### 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();
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con l’API CDK overlay ConnectedPositionStrategy e riproduci il caso di larghezza responsiva descritto nell’issue. Il lavoro è completato quando un popup connesso può corrispondere alla larghezza del relativo elemento padre mentre quest’ultimo cambia, senza applicare stili personalizzati al componente popup; nel report non sono indicati file sorgente o test specifici.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- frontend
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100