angular / angular/components

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

Offen
#10,968 19 Kommentare 32 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/autocomplete area: material/chips P3
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

#### 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 :)

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der verknüpften StackBlitz-Reproduktion, insbesondere mit app/autocomplete-simple-example.html, und führe das Beispiel aus, wobei sowohl matAutocomplete als auch mat-chip-list vorhanden sind. Verfolge, warum setValue des input FormControl in dieser Kombination nicht aktualisiert wird. Erledigt ist die Aufgabe, wenn programmatische Aktualisierungen funktionieren und das Verhalten von Autocomplete und Chip-Liste weiterhin verfügbar ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.