Skip to content

Commit a9a83c2

Browse files
committed
feat(material/radio): Avoid nested divs in labels by changing to span instead.
1 parent d686290 commit a9a83c2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/material/radio/radio.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- TODO(mtlin): Evaluate trade-offs of using native radio vs. cost of additional bindings. -->
33
<label [attr.for]="inputId" class="mat-radio-label" #label>
44
<!-- The actual 'radio' part of the control. -->
5-
<div class="mat-radio-container">
6-
<div class="mat-radio-outer-circle"></div>
7-
<div class="mat-radio-inner-circle"></div>
5+
<span class="mat-radio-container">
6+
<span class="mat-radio-outer-circle"></span>
7+
<span class="mat-radio-inner-circle"></span>
88
<input #input class="mat-radio-input cdk-visually-hidden" type="radio"
99
[id]="inputId"
1010
[checked]="checked"
@@ -21,21 +21,21 @@
2121

2222
<!-- The ripple comes after the input so that we can target it with a CSS
2323
sibling selector when the input is focused. -->
24-
<div mat-ripple class="mat-radio-ripple mat-focus-indicator"
24+
<span mat-ripple class="mat-radio-ripple mat-focus-indicator"
2525
[matRippleTrigger]="label"
2626
[matRippleDisabled]="_isRippleDisabled()"
2727
[matRippleCentered]="true"
2828
[matRippleRadius]="20"
2929
[matRippleAnimation]="{enterDuration: 150}">
3030

31-
<div class="mat-ripple-element mat-radio-persistent-ripple"></div>
32-
</div>
33-
</div>
31+
<span class="mat-ripple-element mat-radio-persistent-ripple"></span>
32+
</span>
33+
</span>
3434

3535
<!-- The label content for radio control. -->
36-
<div class="mat-radio-label-content" [class.mat-radio-label-before]="labelPosition == 'before'">
36+
<span class="mat-radio-label-content" [class.mat-radio-label-before]="labelPosition == 'before'">
3737
<!-- Add an invisible span so JAWS can read the label -->
3838
<span style="display:none">&nbsp;</span>
3939
<ng-content></ng-content>
40-
</div>
40+
</span>
4141
</label>

0 commit comments

Comments
 (0)