feat(select): allow auto-width based on placeholder / value
- Lingua principale
- TypeScript
- Stelle
- 25k
- Fork
- 6.8k
- Merge medio
- 1g 8h
- PR unite (30g)
- 91
Descrizione
### fixed width on mat-form-field
I want my select to have the width of the selected item, fixed width on mat-form-field makes it impossible, you can override `.mat-form-field` to have `width` `auto`, along with overriding `.mat-select-value` to be `width` `auto` and `max-width` `100%`, but then you have a problem, because placeholder is absolutely positioned, which means that the select without any value set yet will be zero width (actually 18px because of the arrow).
https://stackblitz.com/edit/material2-select-width-issues?file=styles.scss
Now I could also override placeholders not to be absolutely positioned, but that's not gonna work properly either, because the arrow is inside the `md-select` element, while the placeholder is outside

I'm not sure if that 200px width is something that's on material spec, but the DOM could perhaps be structured a bit differently, in a way that wouldn't prevent devs from achieving fluid width (which is a bit closer to how native selects work)
## different height when selected vs. placeholder

cc @crisbeto
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Iniziare dalla riproduzione StackBlitz collegata e ispezionare la struttura di mat-form-field e mat-select coinvolta nei casi fixed-width e placeholder. Confrontare il comportamento attuale con il comportamento auto-width richiesto, sia per un placeholder vuoto sia per un valore selezionato; il lavoro è completato quando il select può dimensionarsi in modo fluido senza compromettere il layout della freccia o del placeholder.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- design, frontend
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100