angular / angular/components

bug(mat-chip-grid): FormControl's value does not update on change

Offen
#31,713 6 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/chips P4
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

When setting `{ updateOn: 'change' }`, with ``, the `FormControl`'s value does not update on `change`, it only updates on `blur`.

### Reproduction

StackBlitz link: https://stackblitz.com/edit/micfsvcz?file=src%2Fexample%2Fchips-form-control-example.ts
Steps to reproduce:
1. Modify values in chip input
2. Observe that value of form-control is not getting updated on change
3. Blur out of the form-filed and observe that form-control's value is getting changed

### Expected Behavior

`FormControl`'s value should update on `change` with below:

1. `{ updateOn: 'change' }`
2. ``

### Actual Behavior

`FormControl`'s value is not updating on `change` with below, it is only updating on `blur`:

1. `{ updateOn: 'change' }`
2. ``

### Environment

- Angular: 20.1.0
- CDK/Material: 20.1.0
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with the reproduction in src/example/chips-form-control-example.ts and verify the behavior using the linked StackBlitz example. Trace how mat-chip-grid handles FormControl updates for updateOn: 'change', then confirm that the control value changes before blur and that the existing blur behavior remains intact.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

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