File tree Expand file tree Collapse file tree
src/material-experimental Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,10 +255,11 @@ $mat-typography-level-mappings: (
255255 // Render the focus indicator on focus. Defining a pseudo element's
256256 // content will cause it to render.
257257
258- // For checkboxes and slide toggles, render the focus indicator when we know the hidden input
259- // is focused (slightly different for each control).
258+ // For checkboxes, radios and slide toggles, render the focus indicator when we know
259+ // the hidden input is focused (slightly different for each control).
260260 .mdc-checkbox__native-control :focus ~ .mat-mdc-focus-indicator ::before ,
261261 .mat-mdc-slide-toggle-focused .mat-mdc-focus-indicator ::before ,
262+ .mat-mdc-radio-button.cdk-focused .mat-focus-indicator ::before ,
262263
263264 // For all other components, render the focus indicator on focus.
264265 .mat-mdc-focus-indicator :focus ::before {
Original file line number Diff line number Diff line change 1818 < div class ="mdc-radio__inner-circle "> </ div >
1919 </ div >
2020 < div class ="mdc-radio__ripple "> </ div >
21- < div mat-ripple class ="mat-radio-ripple "
21+ < div mat-ripple class ="mat-radio-ripple mat-focus-indicator "
2222 [matRippleTrigger] ="formField "
2323 [matRippleDisabled] ="_isRippleDisabled() "
2424 [matRippleCentered] ="true "
Original file line number Diff line number Diff line change @@ -394,6 +394,14 @@ describe('MDC-based MatRadio', () => {
394394 expect ( radioNativeElements [ 2 ] . classList ) . toContain ( 'mat-warn' ) ;
395395 } ) ;
396396
397+ it ( 'should have a focus indicator' , ( ) => {
398+ const radioRippleNativeElements =
399+ radioNativeElements . map ( element => element . querySelector ( '.mat-radio-ripple' ) ! ) ;
400+
401+ expect ( radioRippleNativeElements
402+ . every ( element => element . classList . contains ( 'mat-focus-indicator' ) ) ) . toBe ( true ) ;
403+ } ) ;
404+
397405 } ) ;
398406
399407 describe ( 'group with ngModel' , ( ) => {
You can’t perform that action at this time.
0 commit comments