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', () => {
796
796
const radioButtonEl =
797
797
predefinedFixture . debugElement . query ( By . css ( '.mat-mdc-radio-button' ) ) ! . nativeElement ;
798
798
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 ) ;
810
800
} ) ;
811
801
812
802
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> {
97
97
'[class.mat-primary]' : 'color === "primary"' ,
98
98
'[class.mat-accent]' : 'color === "accent"' ,
99
99
'[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' ,
101
102
'[attr.aria-label]' : 'null' ,
102
103
'[attr.aria-labelledby]' : 'null' ,
103
104
'[attr.aria-describedby]' : 'null' ,
Original file line number Diff line number Diff line change @@ -790,7 +790,7 @@ describe('MatRadio', () => {
790
790
const radioButtonEl =
791
791
predefinedFixture . debugElement . query ( By . css ( '.mat-radio-button' ) ) ! . nativeElement ;
792
792
793
- expect ( radioButtonEl . getAttribute ( 'tabindex' ) ) . toBe ( '-1' ) ;
793
+ expect ( radioButtonEl . hasAttribute ( 'tabindex' ) ) . toBe ( false ) ;
794
794
} ) ;
795
795
796
796
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
640
640
'[class.mat-primary]' : 'color === "primary"' ,
641
641
'[class.mat-accent]' : 'color === "accent"' ,
642
642
'[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 ' ,
645
645
'[attr.id]' : 'id' ,
646
646
'[attr.aria-label]' : 'null' ,
647
647
'[attr.aria-labelledby]' : 'null' ,
You can’t perform that action at this time.
0 commit comments