Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Signal form .reset() does not clear Angular Material error styling

Aperta
#33,467 5 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Inizia con la riproduzione StackBlitz collegata e confronta signalForm().reset() con il comportamento di @angular/forms/signals e Angular Material mat-form-field. Traccia come reset aggiorna gli stati touched, dirty e di validazione; il lavoro è completato quando il valore viene reimpostato e il campo Material non mostra più lo stile di errore dopo l'invio.

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

Descrizione

area: material/form-field forms: signals gemini-triaged
Which @angular/* package(s) are the source of the bug?

core, forms

Is this a regression?

No

Description

When using Angular Material form fields (mat-form-field) with signal-based forms (@angular/forms/signals), resetting the form after submission causes the Material input to display error styling (red outline) even though the field should no longer be in a touched or dirty state.

After calling signalForm().reset() on submit, the field value is correctly reset to an empty string. However, the Material form field renders as invalid with error styling applied. According to Angular Material's documented behavior, error styling should only be shown when the control has been touched. Since reset() is expected to clear both the touched and dirty states, the field should return to its pristine, untouched appearance — without any validation error indicators.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/github/mihai3636/2026--angular-signal-form-material-bug?file=src%2Fapp%2Fapp.ts

Please provide the exception or error you saw
N/A
Please provide the environment you discovered this bug in (run ng version)
Angular CLI       : 22.0.4
Angular           : 22.0.4
Node.js           : 26.1.0
Package Manager   : npm 11.13.0
Operating System  : win32 x64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 22.0.4            │ ^22.0.0           │
│ @angular/cdk              │ 22.0.2            │ ^22.0.2           │
│ @angular/cli              │ 22.0.4            │ ^22.0.0           │
│ @angular/common           │ 22.0.4            │ ^22.0.0           │
│ @angular/compiler         │ 22.0.4            │ ^22.0.0           │
│ @angular/compiler-cli     │ 22.0.4            │ ^22.0.0           │
│ @angular/core             │ 22.0.4            │ ^22.0.0           │
│ @angular/forms            │ 22.0.4            │ ^22.0.0           │
│ @angular/material         │ 22.0.2            │ ^22.0.2           │
│ @angular/platform-browser │ 22.0.4            │ ^22.0.0           │
│ @angular/router           │ 22.0.4            │ ^22.0.0           │
│ rxjs                      │ 7.8.2             │ ~7.8.0            │
│ typescript                │ 6.0.3             │ ~6.0.2            │
│ vitest                    │ 4.1.9             │ ^4.0.8            │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else?

No response

Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 1h
PR unite (30g)
84

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di angular/components

Tutte le issue di angular/components

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.