mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
@@ -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"> </span>
|
||||
<ng-content></ng-content>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
@@ -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"> </span>
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user