bug(form-field): Updating input value via `effect`+`FormControl` doesn't trigger label position calculation
- Lingua principale
- TypeScript
- Stelle
- 25k
- Fork
- 6.8k
- Merge medio
- 1g 8h
- PR unite (30g)
- 91
Descrizione
### 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 updating a `FormControl` value inside a signal `effect`, the `MatFormField` floating label does not reposition under `OnPush` change detection unless `ChangeDetectorRef.markForCheck()` is called manually.
### Reproduction
StackBlitz link: https://stackblitz.com/edit/ujogbvgu?file=src%2Fexample%2Fform-field-overview-example.ts
Steps to reproduce:
1. Update input via `FormControl` + `effect`
2. Observe that label position does not update unless `ChangeDetectorRef.markForCheck()` is invoked explicitly.
### Expected Behavior
Using `signal`s and `effect`s, I expected not to have to call `ChangeDetectorRef.markForCheck()` for the label to float.
### Actual Behavior
The label did not float when the control's value was set.
### Environment
- Angular: 20.2.x
- CDK/Material: 20.2.x
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con la riproduzione in src/example/form-field-overview-example.ts ed esegui i passaggi di StackBlitz usando FormControl ed effect con il rilevamento delle modifiche OnPush. Traccia l'aggiornamento della posizione dell'etichetta di MatFormField e verifica che l'etichetta fluttui dopo la modifica del valore del controllo, senza chiamare manualmente ChangeDetectorRef.markForCheck().
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- frontend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100