Skip to content

Commit a9b6135

Browse files
authored
fix(material/form-field): Add mdc-label class to <label> (#26851)
This is added to prevent a bug with the upcoming Theming API for Form Field.
1 parent 56c5ff7 commit a9b6135

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/material/checkbox/checkbox.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
(#14385). Putting a click handler on the <label/> caused this bug because the browser produced
4545
an unnecessary accessibility tree node.
4646
-->
47-
<label #label
47+
<label class="mdc-label"
48+
#label
4849
[for]="inputId">
4950
<ng-content></ng-content>
5051
</label>

src/material/radio/radio.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<div class="mat-ripple-element mat-radio-persistent-ripple"></div>
2626
</div>
2727
</div>
28-
<label [for]="inputId">
28+
<label class="mdc-label" [for]="inputId">
2929
<ng-content></ng-content>
3030
</label>
3131
</div>

src/material/slide-toggle/slide-toggle.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
Clicking on the label will trigger another click event from the button.
4848
Stop propagation here so other listeners further up in the DOM don't execute twice.
4949
-->
50-
<label [for]="buttonId" [attr.id]="_labelId" (click)="$event.stopPropagation()">
50+
<label class="mdc-label" [for]="buttonId" [attr.id]="_labelId" (click)="$event.stopPropagation()">
5151
<ng-content></ng-content>
5252
</label>
5353
</div>

0 commit comments

Comments
 (0)