From e5fe34cab17e29d572c37f6775f3ef0f9f308932 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Tue, 23 Oct 2018 22:47:35 +0200 Subject: [PATCH] fix(checkbox): disabled property not being coerced (#13755) Fixes the `disabled` property not being coerced like all the other components. Fixes #13739. --- src/lib/checkbox/checkbox.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/checkbox/checkbox.ts b/src/lib/checkbox/checkbox.ts index 040e9bd9a93..c30bc5a6ab7 100644 --- a/src/lib/checkbox/checkbox.ts +++ b/src/lib/checkbox/checkbox.ts @@ -245,8 +245,10 @@ export class MatCheckbox extends _MatCheckboxMixinBase implements ControlValueAc @Input() get disabled() { return this._disabled; } set disabled(value: any) { - if (value != this.disabled) { - this._disabled = value; + const newValue = coerceBooleanProperty(value); + + if (newValue !== this.disabled) { + this._disabled = newValue; this._changeDetectorRef.markForCheck(); } }