angular / angular/components

Input's FormControl setValue does not work when mat-form-field has chip-list and input is linked to autocomplete

Aperta
#10,968 19 commenti 32 reazioni 0 assegnatari Vedi su GitHub
area: material/autocomplete area: material/chips P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

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

#### What is the expected behavior?
Input's FormControl's setValue should work for an input that is inside a mat-form-field that has both autocomplete and chip-list.

#### What is the current behavior?
FormControl setValue does not work when the following iff a mat-form-field has an input that has matAutocomplete AND the mat-form-field has a mat-chip-list.

SetValue works if one removes the matAutocomplete directive from the input or removes the mat-chip-list element.

#### What are the steps to reproduce?
Demo should have the input incrementing a number every second, which doesn't work:

https://stackblitz.com/edit/angular-ay3yts?file=app%2Fautocomplete-simple-example.html

Deleting mat-chip-list or removing the matAutocomplete directive fixes the issue.

#### What is the use-case or motivation for changing an existing behavior?
I want to be able to programmatically add a chip then clear the input when an option in the autocomplete has been selected.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular: 5.2.4
Material: 5.2.4

#### Is there anything else we should know?
Nope :)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la riproduzione StackBlitz collegata, in particolare app/autocomplete-simple-example.html, ed esegui l'esempio con matAutocomplete e mat-chip-list presenti. Traccia il motivo per cui setValue del FormControl dell'input non viene aggiornato in questa combinazione. Il lavoro è completato quando gli aggiornamenti programmatici funzionano e il comportamento di autocomplete e chip-list rimane disponibile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.