-
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 urgent
Description
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Change disabled
state programmatically (via setDisabledState
) and via @Input() disabled
What is the current behavior?
If you set the disabled
programmatically, you cannot change it via @Input() disabled
anymore.
If you have:
<mat-selection-list #shoes="matSelectionList" [disabled]="_listDisabled">
<mat-list-option *ngFor="let shoe of typesOfShoes">
{{shoe}}
</mat-list-option>
</mat-selection-list>
And you do:
@ViewChild('shoes') _matSelectionList: MatSelectionList;
_listDisabled = false;
...
this._matSelectionList.setDisabledState(true);
the list is disabled (you cannot select any option) no matter what the value of _listDisabled
is after executing this._matSelectionList.setDisabledState(true)
.
What are the steps to reproduce?
Here you have a Stackblitz demo
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Material 6.3.2
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 urgent