Skip to content
Snippets Groups Projects
Commit b0991607 authored by Marlène SIMONDANT's avatar Marlène SIMONDANT
Browse files

fix(accessibility): checkboxes must have labels and should not be nested in...

fix(accessibility): checkboxes must have labels and should not be nested in another interactive element (button)
parent ddc4420a
No related branches found
No related tags found
2 merge requests!846V3.1.0 (sans impression),!821fix(accessibility): checkbox
<button type="button" tabindex="-1" [ngClass]="{ selected: isChecked }" (click)="clicked()">
<div class="checkbox" tabindex="-1" [ngClass]="{ selected: isChecked }" (click)="clicked()" (keydown.enter)="clicked()">
<app-checkbox [checked]="isChecked" />
<svg *ngIf="iconSvg" aria-hidden="true" class="icon" [ngClass]="iconType">
<use [attr.xlink:href]="'assets/form/sprite.svg#' + iconSvg" />
</svg>
<p>{{ text }}</p>
</button>
<p id="checkboxLabel">{{ text }}</p>
</div>
@import 'color';
@import 'typography';
button {
div.checkbox {
width: 100%;
height: 80px;
padding: 1rem;
......
......@@ -5,5 +5,6 @@
[checked]="checked"
[indeterminate]="indeterminate"
[disabled]="disabled"
[attr.aria-labelledby]="'checkboxLabel'"
(click)="action.emit($event)"
/>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment