CDK overlay auto calculate width when using ConnectedPositionStrategy
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
#### 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();
```
Beitragsleitfaden
Rechercherichtung
Beginne mit der CDK overlay ConnectedPositionStrategy API und reproduziere den im Issue beschriebenen Fall mit responsiver Breite. Erledigt ist die Aufgabe, wenn ein verbundenes Popup die Breite seines übergeordneten Elements übernehmen kann, während sich das übergeordnete Element ändert, ohne benutzerdefiniertes Styling an der Popup-Komponente; im Bericht wird keine bestimmte Quelldatei oder kein bestimmter Test genannt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100