fix(checkbox, radio): Fix checkbox label not read in JAWS (#4610)

* Fix checkbox label not read in JAWS

* use another way
This commit is contained in:
tinayuangao
2017-05-25 17:49:53 -06:00
committed by GitHub
parent 97a9bdc383
commit 5c489497c3
2 changed files with 13 additions and 9 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
<label class="mat-checkbox-layout" #label>
<label [attr.for]="inputId" class="mat-checkbox-layout" #label>
<div class="mat-checkbox-inner-container"
[class.mat-checkbox-inner-container-no-side-margin]="!_hasLabel()">
<input #input
@@ -36,6 +36,8 @@
</div>
</div>
<span class="mat-checkbox-label" #labelWrapper>
<!-- Add an invisible span so JAWS can read the label -->
<span style="display:none">&nbsp;</span>
<ng-content></ng-content>
</span>
</label>
+10 -8
View File
@@ -12,17 +12,19 @@
</div>
<input #input class="mat-radio-input cdk-visually-hidden" type="radio"
[id]="inputId"
[checked]="checked"
[disabled]="disabled"
[name]="name"
[attr.aria-label]="ariaLabel"
[attr.aria-labelledby]="ariaLabelledby"
(change)="_onInputChange($event)"
(click)="_onInputClick($event)">
[id]="inputId"
[checked]="checked"
[disabled]="disabled"
[name]="name"
[attr.aria-label]="ariaLabel"
[attr.aria-labelledby]="ariaLabelledby"
(change)="_onInputChange($event)"
(click)="_onInputClick($event)">
<!-- The label content for radio control. -->
<div class="mat-radio-label-content" [class.mat-radio-label-before]="labelPosition == 'before'">
<!-- Add an invisible span so JAWS can read the label -->
<span style="display:none">&nbsp;</span>
<ng-content></ng-content>
</div>
</label>