Signal form .reset() does not clear Angular Material error styling
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- angular, typescript
- Domaine
- frontend
Piste de recherche
Commencez par la reproduction StackBlitz liée et comparez signalForm().reset() avec le comportement de @angular/forms/signals et de Angular Material mat-form-field. Suivez la manière dont reset met à jour les états touched, dirty et de validation ; le travail est terminé lorsque la valeur est réinitialisée et que le champ Material n'affiche plus le style d'erreur après la soumission.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
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
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 1 h
- PR mergées (30 j)
- 84
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de angular/components
-
area: material/tree docs gemini-triaged needs triage
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
angular/components#33832 ·
-
area: material/datepicker gemini-triaged P4
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
angular/components#33763 · 2 commentaires · 3 réactions ·
-
area: material/table gemini-triaged P4
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
angular/components#33709 · 1 commentaire ·
-
area: material/table docs gemini-triaged P4
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
angular/components#33455 ·
-
area: material/core gemini-triaged P3
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
angular/components#33059 · 2 commentaires ·
Toutes les issues de angular/components
Issues similaires
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Crush Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
ElementsProject/cln-application#167 · 1 commentaire · 1 réaction ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100