mat-error does not display on submit when fields are added in a FormArray
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 91
Descripción
#### Bug, feature request, or proposal:
The `mat-error` directive doesn't display on submit when fields are added in a FormArray. The error is shown when you touch the field. Also when I change the mat-error to a regular div, the div is just being shown.
#### What is the expected behavior?
Show `mat-error` on submit when field is untouched.
#### What is the current behavior?
Does not show `mat-error` on submit when field is untouched.
#### What are the steps to reproduce?
Repro: https://angular-material2-issue-ttt1jk.stackblitz.io/
- Add some fields with Angular Validators in a FormArray (this counts for every field, mat-select, matInput, etc.)
I have HTML like this:
- mat-form-field
-- mat-select
-- mat-error
Or:
- mat-form-field
-- input matInput
-- mat-error
#### What is the use-case or motivation for changing an existing behavior?
Validation needs to be shown on submit so the user knows the field has errors.
#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
- Angular v5.1.0
- Material v5.0.1
- TypeScript v2.4.2
- Every browser
#### Is there anything else we should know?
Guía de contribución
Línea de trabajo
Comienza con la reproducción vinculada de StackBlitz y compara el comportamiento de mat-error para los controles matInput y mat-select añadidos a un FormArray. Verifica los controles no tocados después del envío y después de haber sido tocados. Se considera completado cuando los errores de validación aparecen al enviar para cada campo no válido sin requerir que se haya tocado el campo.
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
- Bastante claro
- Aptitud para principiantes
- 35/100