File tree 3 files changed +20
-73
lines changed
3 files changed +20
-73
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
<!-- TODO(jelbourn): render the radio on either side of the content -->
2
2
<!-- TODO(mtlin): Evaluate trade-offs of using native radio vs. cost of additional bindings. -->
3
- < label [attr.for] ="inputId " class ="md-radio-label ">
3
+ <!-- TODO(crisbeto): only show focus indication if focus came from a keyboard event -->
4
+ < label [attr.for] ="inputId " class ="md-radio-label " [class.md-ripple-focused] ="_isFocused ">
4
5
<!-- The actual 'radio' part of the control. -->
5
6
< div class ="md-radio-container ">
6
7
< div class ="md-radio-outer-circle "> </ div >
Original file line number Diff line number Diff line change @@ -574,6 +574,24 @@ describe('MdRadio', () => {
574
574
expect ( document . activeElement ) . toBe ( fruitRadioNativeInputs [ i ] ) ;
575
575
}
576
576
} ) ;
577
+
578
+ it ( 'should add a ripple when the native input element is focused' , ( ) => {
579
+ let hostElement = seasonRadioInstances [ 0 ] . getHostElement ( ) as HTMLElement ;
580
+ let input = hostElement . querySelector ( 'input' ) as HTMLInputElement ;
581
+ let label = hostElement . querySelector ( 'label' ) as HTMLLabelElement ;
582
+
583
+ expect ( label . classList ) . not . toContain ( 'md-ripple-focused' ) ;
584
+
585
+ dispatchEvent ( 'focus' , input ) ;
586
+ fixture . detectChanges ( ) ;
587
+
588
+ expect ( label . classList ) . toContain ( 'md-ripple-focused' ) ;
589
+
590
+ dispatchEvent ( 'blur' , input ) ;
591
+ fixture . detectChanges ( ) ;
592
+
593
+ expect ( label . classList ) . not . toContain ( 'md-ripple-focused' ) ;
594
+ } ) ;
577
595
} ) ;
578
596
} ) ;
579
597
You can’t perform that action at this time.
0 commit comments