Skip to content

Commit 74aee29

Browse files
committed
fix(material-experimental/mdc-checkbox): remove extra a11y tree node for the <label/>
In the mdc checkbox component, moves the click handler on the label to its parent, the .mdc-checkbox. This removes the extra a11y tree node on the label and fixes TalkBack having an extra navigation stop (#14385). A11y tree before this commit. It has an un-necessary node, which coresponds to the `<label>` element. ``` - Generic - Checkbox, "Field A" - Textlabel, "Field A" ``` A11y tree with this commit applied ``` - Generic - Checkbox, "Field A" ``` fixes #14385
1 parent fb4e395 commit 74aee29

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/material-experimental/mdc-checkbox/checkbox.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
[matRippleDisabled]="disableRipple || disabled"
3838
[matRippleCentered]="true"></div>
3939
</div>
40-
<label #label
41-
[for]="inputId"
42-
(click)="$event.stopPropagation()">
43-
<ng-content></ng-content>
44-
</label>
40+
<span (click)="$event.stopPropagation()">
41+
<label #label [for]="inputId">
42+
<ng-content></ng-content>
43+
</label>
44+
</span>
4545
</div>

0 commit comments

Comments
 (0)