-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(checkbox): update MatCheckbox disabled setter to trigger change d…
…etection (#11098) This is related to #11056, which is a similar fix for MatRadioButton. The MatCheckbox component instance may be accessed directly by a parent component using ViewChild/ContentChild. Since MatCheckbox uses OnPush change detection setting the disabled property directly currently doesn't cause change detection leading to a stale or broken state. Accessing it through a template binding does correctly trigger change detection on MatCheckbox (there are already test cases for this method). We need to add a manual call to markForCheck, or else MatCheckbox will never get kicked if disabled is set directly on the component instance. Related open Angular bug: angular/angular#20611
- Loading branch information
Showing
2 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters