Skip to content

mat-selection-list clears FormControl value when it is removed from view #15994

Closed
@mko0

Description

@mko0

What is the expected behavior?

Component mat-selection-list shouldn't change FormControl value when it is removed from view.

What is the current behavior?

Component mat-selection-list clears FormControl value when it is removed from view.

What are the steps to reproduce?

Material 7.1.1 (version i'm using)
https://stackblitz.com/edit/test-angular-mat-selection-list-7-1-1
Material 7.3.7 (latest)
https://stackblitz.com/edit/test-angular-mat-selection-list-7-3-7

  1. Open stackblitz console window
  2. Click "Select All" button
  3. Click "Toggle View" button
  4. Observe FormsControl.valueChanges logs when mat-selection-list is removed from view:

image

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 7.x.x
Material 7.x.x

Is there anything else we should know?

I don't think so.

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions