Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mat-selection-list list-options is not updated when formControl for mat-selection-list is updated with setValue #15477

EmilienRamos opened this Issue Mar 14, 2019 · 0 comments


None yet
1 participant
Copy link

EmilienRamos commented Mar 14, 2019

What is the expected behavior?

Checkboxes should update

What is the current behavior?

Checkboxes do not update.

What are the steps to reproduce?


<mat-selection-list formControlName="role">
    <mat-list-option checkboxPosition="before" *ngFor="let role of roles" [value]="">{{ }}</mat-list-option>

editor.component.ts (onInit)

this.form ={
    role: [[...this.user.attributes.role], Validators.required],

this.user.attributes.role is an array of string.

I tried

ngAfterContentInit() {
        'role': [...this.user.attributes.role]

I also tried

ngAfterContentInit() {
    setTimeout(() => {
        'role': [...this.user.attributes.role]
    }, 1000);

Note that I'm getting roles with an observable :

      // Others observables ...
      this.jsonApi.all('roles').pipe(map(document =>,
    ).subscribe(([firms, langs, roles]) => {
      // Others observables ...
      this.roles = roles;

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 know there's a ticket about this, but it's closed and no one replies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.