Closed
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Setting selectable="false"
on MatChipList doesn't work as expected.
The selectable
property of MatChipList is propagated to the contained chips in line 334.
However, the initial input value is set before the MatChip ContentChildren are initialized. Thus only later value changes propagate to the individual chips.
Reproduction
Steps to reproduce:
- Open StackBlitz
- Initial state of
selectable
isfalse
- Initial state of
- Focus one of the chips
- Press [SPACE]
- Selection of focused chip changes (although it shouldn't)
- Check the "Selectable" checkbox
- Uncheck the "Selectable" checkbox
- Focus one of the chips
- Press [SPACE]
- Selection of focused chip doesn't change (as expected)
Expected Behavior
Setting <mat-chip-list selectable="false">
should prevent selection of chips
Actual Behavior
Setting <mat-chip-list selectable="false">
doesn't prevent selection of chips
Environment
- Angular: 12, 13
- CDK/Material: 12, 13
- Browser(s): Chrome 101.0.4951.54, Firefox 91.8.0esr (32-Bit), Edge 101.0.1210.32
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10 Enterprise, Build 19042.1645