Skip to content

Setting initial value of MatSelect using Reactive Forms does not set matSelect.value #18423

Closed
@trevorhreed

Description

@trevorhreed

Reproduction

StackBlitz: https://stackblitz.com/edit/angular-reabu9?file=src%2Fapp%2Fapp.module.ts

Steps to reproduce:
0. (Skip these steps and just refer to the StackBlitz)

  1. Create a Reactive Form with MatSelect component
  2. Set the initial value for the MatSelect component when creating the form (e.g. with FormBuilder, etc.)
  3. Display the value of the MatSelect (e.g. using a template ref: <mat-select #select>...</mat-select> ... {{ #select.value }})

Expected Behavior

The value of #select.value should be equal to the initial value set in the FormGroup/FormControl

Actual Behavior

The value for #select.value is empty

Environment

  • Angular: 8
  • CDK/Material: 8
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/select

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions