Skip to content

Commit

Permalink
fix(material/checkbox): add the boolean property coercion for checked…
Browse files Browse the repository at this point in the history
… input (#20645)

(cherry picked from commit 1e9092a)
  • Loading branch information
klemenoslaj authored and andrewseguin committed Apr 1, 2022
1 parent 949e3c7 commit 1e010a3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/material/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,11 @@ export class MatCheckbox
get checked(): boolean {
return this._checked;
}
set checked(value: boolean) {
if (value != this.checked) {
this._checked = value;
set checked(value: BooleanInput) {
const checked = coerceBooleanProperty(value);

if (checked != this.checked) {
this._checked = checked;
this._changeDetectorRef.markForCheck();
}
}
Expand Down

0 comments on commit 1e010a3

Please sign in to comment.