angular / angular/components

mat-select in multiple mode is difficult to use with reactive forms

オープン
#11,006 コメント 3 件 リアクション 4 件 担当者 0 名 GitHub で見る
area: material/select P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

#### Bug, feature request, or proposal:
feature request

#### What is the expected behavior?
`mat-select` in `multiple` mode lets me put `formControls` on individual options

#### What is the current behavior?
I have a list of boolean options (checkboxes) that a user can set. `formControl` only works on the mat-select, which is populated with an array. If I want to prepopulate those, I need to manually build an array to set on my `mat-select`. I cannot bind to `valueChanges` on individual options.

#### What is the use-case or motivation for changing an existing behavior?
Manually keeping this array updated and in sync with my individual settings is painful. I'd rather create `formControl`s for each option, which I can bind to and set/patch as I need to. Perhaps let me set a `formGroup` on the `mat-select` instead of a `formControl`?

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
"@angular/core": "5.2.9",
"@angular/material": "5.2.4",
"typescript": "2.8.1"

#### Is there anything else we should know?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、Angular reactive forms を使って報告された mat-select の multiple-mode の構成を再現し、select と個々の option、およびそれらの valueChanges に対する formControl の動作に焦点を当てます。ユーザーが配列を手動で同期せずに個々の option controls をバインドして事前入力でき、サポートされる form API と動作がテストで文書化されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。