Skip to content
Snippets Groups Projects
Commit 6597f3c7 authored by Sophie Richard's avatar Sophie Richard
Browse files

fix(select): ajout aria-selected sur les options

parent 57b71919
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
- feat(segmented-control): ajout du composant `dsfr-segmented-control`
- fix(header): traductions manquantes sur boutons 'Fermer'
- fix(header): affichage lien rubrique mega-menu
- fix(select): fix accessibilité, ajout attribut `aria-selected` sur les options
# 1.9.3
......
......@@ -28,6 +28,7 @@
<option
*ngFor="let option of options; trackBy: trackByIndex"
[ngValue]="option.value"
[attr.aria-selected]="compareFn(option.value, value)"
[disabled]="option.disabled || null">
{{ option.label }}
</option>
......@@ -48,7 +49,11 @@
(change)="onChange()">
<option *ngIf="!value" [value]="value" selected hidden disabled>{{ placeholder }}</option>
<ng-container *ngFor="let option of options; trackBy: trackByIndex">
<option *ngIf="!option.options" [ngValue]="option.value" [disabled]="option.disabled || null">
<option
*ngIf="!option.options"
[ngValue]="option.value"
[attr.aria-selected]="compareFn(option.value, value)"
[disabled]="option.disabled || null">
{{ option.label }}
</option>
</ng-container>
......@@ -58,6 +63,7 @@
<option
*ngFor="let option of option.options; trackBy: trackByIndex"
[ngValue]="option.value"
[attr.aria-selected]="compareFn(option.value, value)"
[disabled]="option.disabled || null">
{{ option.label }}
</option>
......
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