mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(radio-group): coerce disabled property (#5837)
This commit is contained in:
@@ -67,11 +67,24 @@ describe('MdRadio', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('should coerce the disabled binding on the radio group', () => {
|
||||
(groupInstance as any).disabled = '';
|
||||
fixture.detectChanges();
|
||||
|
||||
radioLabelElements[0].click();
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(radioInstances[0].checked).toBe(false);
|
||||
expect(groupInstance.disabled).toBe(true);
|
||||
});
|
||||
|
||||
it('should disable click interaction when the group is disabled', () => {
|
||||
testComponent.isGroupDisabled = true;
|
||||
fixture.detectChanges();
|
||||
|
||||
radioLabelElements[0].click();
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(radioInstances[0].checked).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
@@ -186,11 +186,11 @@ export class MdRadioGroup extends _MdRadioGroupMixinBase
|
||||
this._checkSelectedRadioButton();
|
||||
}
|
||||
|
||||
/** Whether the radio group is diabled */
|
||||
/** Whether the radio group is disabled */
|
||||
@Input()
|
||||
get disabled() { return this._disabled; }
|
||||
set disabled(value) {
|
||||
this._disabled = value;
|
||||
this._disabled = coerceBooleanProperty(value);
|
||||
this._markRadiosForCheck();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user