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 @@ -788,17 +788,7 @@ describe('MDC-based MatRadio', () => {
788
788
const radioButtonEl =
789
789
predefinedFixture . debugElement . query ( By . css ( '.mat-mdc-radio-button' ) ) ! . nativeElement ;
790
790
791
- expect ( radioButtonEl . getAttribute ( 'tabindex' ) ) . toBe ( '-1' ) ;
792
- } ) ;
793
-
794
- it ( 'should set the tabindex to -1 on the host element' , ( ) => {
795
- const predefinedFixture = TestBed . createComponent ( RadioButtonWithPredefinedTabindex ) ;
796
- predefinedFixture . detectChanges ( ) ;
797
-
798
- const radioButtonEl =
799
- predefinedFixture . debugElement . query ( By . css ( '.mat-mdc-radio-button' ) ) ! . nativeElement ;
800
-
801
- expect ( radioButtonEl . getAttribute ( 'tabindex' ) ) . toBe ( '-1' ) ;
791
+ expect ( radioButtonEl . hasAttribute ( 'tabindex' ) ) . toBe ( false ) ;
802
792
} ) ;
803
793
804
794
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 @@ -781,7 +781,7 @@ describe('MatRadio', () => {
781
781
const radioButtonEl =
782
782
predefinedFixture . debugElement . query ( By . css ( '.mat-radio-button' ) ) ! . nativeElement ;
783
783
784
- expect ( radioButtonEl . getAttribute ( 'tabindex' ) ) . toBe ( '-1' ) ;
784
+ expect ( radioButtonEl . hasAttribute ( 'tabindex' ) ) . toBe ( false ) ;
785
785
} ) ;
786
786
787
787
it ( 'should forward a pre-defined tabindex to the underlying input' , ( ) => {
Original file line number Diff line number Diff line change @@ -636,8 +636,8 @@ export abstract class _MatRadioButtonBase extends _MatRadioButtonMixinBase imple
636
636
'[class.mat-primary]' : 'color === "primary"' ,
637
637
'[class.mat-accent]' : 'color === "accent"' ,
638
638
'[class.mat-warn]' : 'color === "warn"' ,
639
- // Needs to be -1 so the `focus` event still fires .
640
- '[attr.tabindex]' : '-1 ' ,
639
+ // Needs to be removed since it causes some a11y issues (see #21266) .
640
+ '[attr.tabindex]' : 'null ' ,
641
641
'[attr.id]' : 'id' ,
642
642
'[attr.aria-label]' : 'null' ,
643
643
'[attr.aria-labelledby]' : 'null' ,
You can’t perform that action at this time.
0 commit comments