Skip to content

Commit 872ed88

Browse files
committed
fix
1 parent 68b9a45 commit 872ed88

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@
5353
</span>
5454
</button>
5555

56-
<!--
57-
Clicking on the label will trigger another click event from the button.
58-
Stop propagation here so other listeners further up in the DOM don't execute twice.
59-
-->
60-
@if (!hideLabel) {
56+
@if (hideLabel) {
57+
<div class="aria-hidden" [attr.id]="_labelId">
58+
<ng-content></ng-content>
59+
</div>
60+
} @else {
61+
<!--
62+
Clicking on the label will trigger another click event from the button.
63+
Stop propagation here so other listeners further up in the DOM don't execute twice.
64+
-->
6165
<label class="mdc-label" [for]="buttonId" [attr.id]="_labelId" (click)="$event.stopPropagation()">
6266
<ng-content></ng-content>
6367
</label>

0 commit comments

Comments
 (0)