-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/list
Description
For the mat-selection-list
with multiple selections disabled the model change event is fired twice.
StackBlitz to reproduce:
Steps to reproduce:
- Change the selection
- View result in the console:
onChange
is called twice.
Essential part of code:
<mat-selection-list [multiple]="false" [(ngModel)]="myValue" (ngModelChange)="onChange($event)">
...
</mat-selection-list>
An example is showing binding via [(ngModel)]
, but the same behavior is observed with reactive forms when valueChanges
are fired twice.
Expected Behavior
Model change should be fired once similar as it works for lists with multiple selections allowed.
Actual Behavior
Model change is fired twice.
Environment
- Angular: 11.2.5
- CDK/Material: 11.2.4
- Browser(s): Chrome 88.0.4324.150
- Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu
Edit: added essential part of code to the issue itself.
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/list