File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -67,11 +67,24 @@ describe('MdRadio', () => {
67
67
}
68
68
} ) ;
69
69
70
+ it ( 'should coerce the disabled binding on the radio group' , ( ) => {
71
+ ( groupInstance as any ) . disabled = '' ;
72
+ fixture . detectChanges ( ) ;
73
+
74
+ radioLabelElements [ 0 ] . click ( ) ;
75
+ fixture . detectChanges ( ) ;
76
+
77
+ expect ( radioInstances [ 0 ] . checked ) . toBe ( false ) ;
78
+ expect ( groupInstance . disabled ) . toBe ( true ) ;
79
+ } ) ;
80
+
70
81
it ( 'should disable click interaction when the group is disabled' , ( ) => {
71
82
testComponent . isGroupDisabled = true ;
72
83
fixture . detectChanges ( ) ;
73
84
74
85
radioLabelElements [ 0 ] . click ( ) ;
86
+ fixture . detectChanges ( ) ;
87
+
75
88
expect ( radioInstances [ 0 ] . checked ) . toBe ( false ) ;
76
89
} ) ;
77
90
Original file line number Diff line number Diff line change @@ -186,11 +186,11 @@ export class MdRadioGroup extends _MdRadioGroupMixinBase
186
186
this . _checkSelectedRadioButton ( ) ;
187
187
}
188
188
189
- /** Whether the radio group is diabled */
189
+ /** Whether the radio group is disabled */
190
190
@Input ( )
191
191
get disabled ( ) { return this . _disabled ; }
192
192
set disabled ( value ) {
193
- this . _disabled = value ;
193
+ this . _disabled = coerceBooleanProperty ( value ) ;
194
194
this . _markRadiosForCheck ( ) ;
195
195
}
196
196
You can’t perform that action at this time.
0 commit comments