mat-error does not display on submit when fields are added in a FormArray
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
#### 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?
コントリビューションガイド
調査の方向性
リンクされている StackBlitz の再現から始め、FormArray に追加された matInput と mat-select コントロールについて mat-error の動作を比較します。送信後、および触れた後の未操作のコントロールを確認します。完了条件は、フィールドに触れていなくても、送信時にすべての無効なフィールドに対してバリデーションエラーが表示されることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100