Skip to content

Commit 5b9adfa

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

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/material/checkbox/checkbox.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<label [attr.for]="inputId" class="mat-checkbox-layout" #label>
2-
<div class="mat-checkbox-inner-container"
2+
<span class="mat-checkbox-inner-container"
33
[class.mat-checkbox-inner-container-no-side-margin]="!checkboxLabel.textContent || !checkboxLabel.textContent.trim()">
44
<input #input
55
class="mat-checkbox-input cdk-visually-hidden" type="checkbox"
@@ -16,16 +16,16 @@
1616
[attr.aria-describedby]="ariaDescribedby"
1717
(change)="_onInteractionEvent($event)"
1818
(click)="_onInputClick($event)">
19-
<div matRipple class="mat-checkbox-ripple mat-focus-indicator"
19+
<span matRipple class="mat-checkbox-ripple mat-focus-indicator"
2020
[matRippleTrigger]="label"
2121
[matRippleDisabled]="_isRippleDisabled()"
2222
[matRippleRadius]="20"
2323
[matRippleCentered]="true"
2424
[matRippleAnimation]="{enterDuration: 150}">
25-
<div class="mat-ripple-element mat-checkbox-persistent-ripple"></div>
26-
</div>
27-
<div class="mat-checkbox-frame"></div>
28-
<div class="mat-checkbox-background">
25+
<span class="mat-ripple-element mat-checkbox-persistent-ripple"></span>
26+
</span>
27+
<span class="mat-checkbox-frame"></span>
28+
<span class="mat-checkbox-background">
2929
<svg version="1.1"
3030
focusable="false"
3131
class="mat-checkbox-checkmark"
@@ -37,9 +37,9 @@
3737
d="M4.1,12.7 9,17.6 20.3,6.3"/>
3838
</svg>
3939
<!-- Element for rendering the indeterminate state checkbox. -->
40-
<div class="mat-checkbox-mixedmark"></div>
41-
</div>
42-
</div>
40+
<span class="mat-checkbox-mixedmark"></span>
41+
</span>
42+
</span>
4343
<span class="mat-checkbox-label" #checkboxLabel (cdkObserveContent)="_onLabelTextChange()">
4444
<!-- Add an invisible span so JAWS can read the label -->
4545
<span style="display:none">&nbsp;</span>

0 commit comments

Comments
 (0)