File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1515 [id] ="inputId "
1616 [checked] ="checked "
1717 [disabled] ="disabled "
18- [name] ="name "
18+ [attr. name] ="name "
1919 [required] ="required "
2020 [attr.aria-label] ="ariaLabel "
2121 [attr.aria-labelledby] ="ariaLabelledby "
Original file line number Diff line number Diff line change @@ -638,6 +638,12 @@ describe('MatRadio', () => {
638638 expect ( document . activeElement ) . toBe ( fruitRadioNativeInputs [ i ] ) ;
639639 }
640640 } ) ;
641+
642+ it ( 'should not add the "name" attribute if it is not passed in' , ( ) => {
643+ const radio = fixture . debugElement . nativeElement . querySelector ( '#nameless input' ) ;
644+ expect ( radio . hasAttribute ( 'name' ) ) . toBe ( false ) ;
645+ } ) ;
646+
641647 } ) ;
642648
643649 describe ( 'with tabindex' , ( ) => {
@@ -711,6 +717,7 @@ class RadiosInsideRadioGroup {
711717 [aria-labelledby]="ariaLabelledby">
712718 </mat-radio-button>
713719 <mat-radio-button name="fruit" value="raspberry">Raspberry</mat-radio-button>
720+ <mat-radio-button id="nameless" value="no-name">No name</mat-radio-button>
714721 `
715722} )
716723class StandaloneRadioButtons {
You can’t perform that action at this time.
0 commit comments