angular / angular/components

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

Abierto
#11,006 3 comentarios 4 reacciones 0 asignados Ver en GitHub
area: material/select P4
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:
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?

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza reproduciendo la configuración reportada de mat-select en multiple-mode con Angular reactive forms, centrándote en el comportamiento de formControl para el select frente a las options individuales y sus valueChanges. La tarea estará terminada cuando los usuarios puedan enlazar y preconfigurar controles de options individuales sin sincronizar manualmente un array, y la form API y el comportamiento compatibles estén documentados mediante tests.

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
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.