Skip to content

Commit 80491a9

Browse files
dharmeshpipariyajelbourn
authored andcommitted
fix(checkbox): disable for all non-false values (#1631)
1 parent af39236 commit 80491a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/checkbox/checkbox.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,15 @@ export class MdCheckbox implements ControlValueAccessor {
112112
/** Whether or not the checkbox should come before or after the label. */
113113
@Input() align: 'start' | 'end' = 'start';
114114

115+
private _disabled: boolean;
116+
115117
/**
116118
* Whether the checkbox is disabled. When the checkbox is disabled it cannot be interacted with.
117119
* The correct ARIA attributes are applied to denote this to assistive technology.
118120
*/
119-
@Input() disabled: boolean = false;
121+
@Input()
122+
get disabled(): boolean { return this._disabled; }
123+
set disabled(value) { this._disabled = coerceBooleanProperty(value); }
120124

121125
/**
122126
* The tabindex attribute for the checkbox. Note that when the checkbox is disabled, the attribute

0 commit comments

Comments
 (0)