File tree Expand file tree Collapse file tree 4 files changed +6
-15
lines changed
material-experimental/mdc-radio Expand file tree Collapse file tree 4 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -796,17 +796,7 @@ describe('MDC-based MatRadio', () => {
796796 const radioButtonEl =
797797 predefinedFixture . debugElement . query ( By . css ( '.mat-mdc-radio-button' ) ) ! . nativeElement ;
798798
799- expect ( radioButtonEl . getAttribute ( 'tabindex' ) ) . toBe ( '-1' ) ;
800- } ) ;
801-
802- it ( 'should set the tabindex to -1 on the host element' , ( ) => {
803- const predefinedFixture = TestBed . createComponent ( RadioButtonWithPredefinedTabindex ) ;
804- predefinedFixture . detectChanges ( ) ;
805-
806- const radioButtonEl =
807- predefinedFixture . debugElement . query ( By . css ( '.mat-mdc-radio-button' ) ) ! . nativeElement ;
808-
809- expect ( radioButtonEl . getAttribute ( 'tabindex' ) ) . toBe ( '-1' ) ;
799+ expect ( radioButtonEl . hasAttribute ( 'tabindex' ) ) . toBe ( false ) ;
810800 } ) ;
811801
812802 it ( 'should forward a pre-defined tabindex to the underlying input' , ( ) => {
Original file line number Diff line number Diff line change @@ -97,7 +97,8 @@ export class MatRadioGroup extends _MatRadioGroupBase<MatRadioButton> {
9797 '[class.mat-primary]' : 'color === "primary"' ,
9898 '[class.mat-accent]' : 'color === "accent"' ,
9999 '[class.mat-warn]' : 'color === "warn"' ,
100- '[attr.tabindex]' : 'disabled ? null : -1' ,
100+ // Needs to be removed since it causes some a11y issues (see #21266).
101+ '[attr.tabindex]' : 'null' ,
101102 '[attr.aria-label]' : 'null' ,
102103 '[attr.aria-labelledby]' : 'null' ,
103104 '[attr.aria-describedby]' : 'null' ,
Original file line number Diff line number Diff line change @@ -790,7 +790,7 @@ describe('MatRadio', () => {
790790 const radioButtonEl =
791791 predefinedFixture . debugElement . query ( By . css ( '.mat-radio-button' ) ) ! . nativeElement ;
792792
793- expect ( radioButtonEl . getAttribute ( 'tabindex' ) ) . toBe ( '-1' ) ;
793+ expect ( radioButtonEl . hasAttribute ( 'tabindex' ) ) . toBe ( false ) ;
794794 } ) ;
795795
796796 it ( 'should forward a pre-defined tabindex to the underlying input' , ( ) => {
Original file line number Diff line number Diff line change @@ -640,8 +640,8 @@ export abstract class _MatRadioButtonBase extends _MatRadioButtonMixinBase imple
640640 '[class.mat-primary]' : 'color === "primary"' ,
641641 '[class.mat-accent]' : 'color === "accent"' ,
642642 '[class.mat-warn]' : 'color === "warn"' ,
643- // Needs to be -1 so the `focus` event still fires .
644- '[attr.tabindex]' : '-1 ' ,
643+ // Needs to be removed since it causes some a11y issues (see #21266) .
644+ '[attr.tabindex]' : 'null ' ,
645645 '[attr.id]' : 'id' ,
646646 '[attr.aria-label]' : 'null' ,
647647 '[attr.aria-labelledby]' : 'null' ,
You can’t perform that action at this time.
0 commit comments