Skip to content

Chip-list overrides initial chip selected state #7261

@jelbourn

Description

@jelbourn

Say you have a template like this:

<mat-chip-list>
  <mat-chip *ngFor="let i of items" selected="true"> {{i}} </mat-chip>
</mat-chip-list>

Because of this async behavior in chip-list:
https://github.com/angular/material2/blob/3571f68a2de0833ee4741af8a0eb24d1da174f38/src/lib/chips/chip-list.ts#L574-L577

The individual chip selection gets overwritten by the chip-list on init.

@tinayuangao we should find a way to avoid using Promise.resolve here

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2The issue is important to a large percentage of users, with a workaround

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions