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', () => {
6868 }
6969 } ) ;
7070
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+
7176 it ( 'should coerce the disabled binding on the radio group' , ( ) => {
7277 ( groupInstance as any ) . disabled = '' ;
7378 fixture . detectChanges ( ) ;
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ export class MatLegacyRadioGroup extends _MatRadioGroupBase<MatLegacyRadioButton
8787 '[attr.aria-label]' : 'null' ,
8888 '[attr.aria-labelledby]' : 'null' ,
8989 '[attr.aria-describedby]' : 'null' ,
90+ '[attr.name]' : 'null' ,
9091 // Note: under normal conditions focus shouldn't land on this element, however it may be
9192 // programmatically set, for example inside of a focus trap, in this case we want to forward
9293 // the focus to the native element.
Original file line number Diff line number Diff line change @@ -76,6 +76,11 @@ describe('MDC-based MatRadio', () => {
7676 }
7777 } ) ;
7878
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+
7984 it ( 'should coerce the disabled binding on the radio group' , ( ) => {
8085 ( groupInstance as any ) . disabled = '' ;
8186 fixture . detectChanges ( ) ;
@@ -821,6 +826,10 @@ describe('MDC-based MatRadio', () => {
821826 it ( 'should default the radio color to `accent`' , ( ) => {
822827 expect ( seasonRadioInstances . every ( radio => radio . color === 'accent' ) ) . toBe ( true ) ;
823828 } ) ;
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+ } ) ;
824833 } ) ;
825834
826835 describe ( 'with tabindex' , ( ) => {
Original file line number Diff line number Diff line change @@ -685,6 +685,7 @@ export class MatRadioGroup extends _MatRadioGroupBase<MatRadioButton> {
685685 '[attr.aria-label]' : 'null' ,
686686 '[attr.aria-labelledby]' : 'null' ,
687687 '[attr.aria-describedby]' : 'null' ,
688+ '[attr.name]' : 'null' ,
688689 // Note: under normal conditions focus shouldn't land on this element, however it may be
689690 // programmatically set, for example inside of a focus trap, in this case we want to forward
690691 // the focus to the native element.
You can’t perform that action at this time.
0 commit comments