Skip to content

Commit cee8c65

Browse files
crisbetommalerba
authored andcommitted
fix(checkbox): disabled property not being coerced (#13755)
Fixes the `disabled` property not being coerced like all the other components. Fixes #13739.
1 parent 591e987 commit cee8c65

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib/checkbox/checkbox.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,10 @@ export class MatCheckbox extends _MatCheckboxMixinBase implements ControlValueAc
245245
@Input()
246246
get disabled() { return this._disabled; }
247247
set disabled(value: any) {
248-
if (value != this.disabled) {
249-
this._disabled = value;
248+
const newValue = coerceBooleanProperty(value);
249+
250+
if (newValue !== this.disabled) {
251+
this._disabled = newValue;
250252
this._changeDetectorRef.markForCheck();
251253
}
252254
}

0 commit comments

Comments
 (0)