File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ describe('MatRadio', () => {
68
68
}
69
69
} ) ;
70
70
71
+ it ( 'should clear the name attribute from the radio group host node' , ( ) => {
72
+ expect ( groupInstance . name ) . toBeTruthy ( ) ;
73
+ expect ( groupDebugElement . nativeElement . getAttribute ( 'name' ) ) . toBeFalsy ( ) ;
74
+ } ) ;
75
+
71
76
it ( 'should coerce the disabled binding on the radio group' , ( ) => {
72
77
( groupInstance as any ) . disabled = '' ;
73
78
fixture . detectChanges ( ) ;
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ export class MatLegacyRadioGroup extends _MatRadioGroupBase<MatLegacyRadioButton
87
87
'[attr.aria-label]' : 'null' ,
88
88
'[attr.aria-labelledby]' : 'null' ,
89
89
'[attr.aria-describedby]' : 'null' ,
90
+ '[attr.name]' : 'null' ,
90
91
// Note: under normal conditions focus shouldn't land on this element, however it may be
91
92
// programmatically set, for example inside of a focus trap, in this case we want to forward
92
93
// the focus to the native element.
Original file line number Diff line number Diff line change @@ -76,6 +76,11 @@ describe('MDC-based MatRadio', () => {
76
76
}
77
77
} ) ;
78
78
79
+ it ( 'should clear the name attribute from the radio group host node' , ( ) => {
80
+ expect ( groupInstance . name ) . toBeTruthy ( ) ;
81
+ expect ( groupDebugElement . nativeElement . getAttribute ( 'name' ) ) . toBeFalsy ( ) ;
82
+ } ) ;
83
+
79
84
it ( 'should coerce the disabled binding on the radio group' , ( ) => {
80
85
( groupInstance as any ) . disabled = '' ;
81
86
fixture . detectChanges ( ) ;
@@ -821,6 +826,10 @@ describe('MDC-based MatRadio', () => {
821
826
it ( 'should default the radio color to `accent`' , ( ) => {
822
827
expect ( seasonRadioInstances . every ( radio => radio . color === 'accent' ) ) . toBe ( true ) ;
823
828
} ) ;
829
+
830
+ it ( 'should clear the name attribute from the radio host node' , ( ) => {
831
+ expect ( radioDebugElements . every ( el => ! el . nativeElement . getAttribute ( 'name' ) ) ) . toBe ( true ) ;
832
+ } ) ;
824
833
} ) ;
825
834
826
835
describe ( 'with tabindex' , ( ) => {
Original file line number Diff line number Diff line change @@ -685,6 +685,7 @@ export class MatRadioGroup extends _MatRadioGroupBase<MatRadioButton> {
685
685
'[attr.aria-label]' : 'null' ,
686
686
'[attr.aria-labelledby]' : 'null' ,
687
687
'[attr.aria-describedby]' : 'null' ,
688
+ '[attr.name]' : 'null' ,
688
689
// Note: under normal conditions focus shouldn't land on this element, however it may be
689
690
// programmatically set, for example inside of a focus trap, in this case we want to forward
690
691
// the focus to the native element.
You can’t perform that action at this time.
0 commit comments