MatInput does not clear error state on form reset
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 91
Descripción
**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?
Guía de contribución
Línea de trabajo
Reproduce el comportamiento desde el punto de entrada submitCategoryForm, especialmente la llamada categoryForm.reset({ title: '', imageUrl: '' }), utilizando las versiones indicadas Angular 6 y Material 6.4.7 si están disponibles. Determina si reset debería mantener ocultos los errores de los campos obligatorios y, a continuación, añade o actualiza la prueba relevante del formulario/input para verificar el estado esperado después del restablecimiento.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, typescript
- Área
- frontend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100