File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,20 @@ describe('MdCheckbox', () => {
332332 expect ( checkboxDebugElement . nativeElement . classList . contains ( 'custom-class' ) ) . toBe ( true ) ;
333333
334334 } ) ;
335+
336+ it ( 'should activate the ripple focused class when the input is focused' , ( ) => {
337+ expect ( checkboxNativeElement . classList ) . not . toContain ( 'md-ripple-focused' ) ;
338+
339+ checkboxInstance . _onInputFocus ( ) ;
340+ fixture . detectChanges ( ) ;
341+
342+ expect ( checkboxNativeElement . classList ) . toContain ( 'md-ripple-focused' ) ;
343+
344+ checkboxInstance . _onInputBlur ( ) ;
345+ fixture . detectChanges ( ) ;
346+
347+ expect ( checkboxNativeElement . classList ) . not . toContain ( 'md-ripple-focused' ) ;
348+ } ) ;
335349 } ) ;
336350
337351 describe ( 'state transition css classes' , ( ) => {
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export class MdCheckboxChange {
7373 '[class.md-checkbox-checked]' : 'checked' ,
7474 '[class.md-checkbox-disabled]' : 'disabled' ,
7575 '[class.md-checkbox-align-end]' : 'align == "end"' ,
76- '[class.md-checkbox -focused]' : '_hasFocus' ,
76+ '[class.md-ripple -focused]' : '_hasFocus' , // TODO: should only be triggered by keyboard focus
7777 } ,
7878 providers : [ MD_CHECKBOX_CONTROL_VALUE_ACCESSOR ] ,
7979 encapsulation : ViewEncapsulation . None ,
You can’t perform that action at this time.
0 commit comments