MatInput does not clear error state on form reset
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
**This is my submiting function**
public submitCategoryForm(): void {
this.buttonText = 'Processing...';
this.isClicked = true;
const categoryData = this.categoryForm.value;
this.categoryModel = new CategoryInputModel(
categoryData['title'],
categoryData['imageUrl']
);
this.categoryServices.addNewCategory(this.categoryModel).subscribe(() => {
this.buttonText = 'Add';
this.isClicked = false;
this.categoryForm.reset({ title: '', imageUrl: '' });
});
}
#### What is the use-case or motivation for changing an existing behavior?
After submiting my form (successfully) and reset values of the form, validations for required value pop up. How i can submit my form clear values and to make sure validations are not shown.
#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 6, Material 6.4.7
#### Is there anything else we should know?
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Reproduisez le comportement à partir du point d’entrée submitCategoryForm, en particulier l’appel categoryForm.reset({ title: '', imageUrl: '' }), en utilisant les versions signalées Angular 6 et Material 6.4.7 si elles sont disponibles. Déterminez si reset doit laisser les erreurs des champs obligatoires masquées, puis ajoutez ou mettez à jour le test pertinent du formulaire/de l’input afin de vérifier l’état attendu après la réinitialisation.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100