From 7fb4abd6e9d6feae178cd4c59f56df23f246adfe Mon Sep 17 00:00:00 2001 From: Marlene Simondant <msimondant@grandlyon.com> Date: Tue, 30 Jul 2024 15:13:29 +0200 Subject: [PATCH] fix (accessibility): add accessibility attributes to news tabs --- .../post/components/post-header/post-header.component.html | 4 +++- src/app/post/components/post-list/post-list.component.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/post/components/post-header/post-header.component.html b/src/app/post/components/post-header/post-header.component.html index e67e66190..a24a9232a 100644 --- a/src/app/post/components/post-header/post-header.component.html +++ b/src/app/post/components/post-header/post-header.component.html @@ -9,12 +9,14 @@ </div> <nav> - <div role="tablist" class="navigation"> + <div role="tablist" class="navigation" aria-label="Filtrer les actualités"> <div *ngFor="let tag of tags.others" class="tag" role="tab" tabindex="0" + aria-controls="posts" + [attr.aria-selected]="tag.slug === mainActiveTag.slug ? true : false" [ngClass]="{ active: tag.slug === mainActiveTag.slug || tag.name === mainActiveTag.slug }" (click)="activateTag(tag)" (keydown.enter)="activateTag(tag)" diff --git a/src/app/post/components/post-list/post-list.component.html b/src/app/post/components/post-list/post-list.component.html index 2beb8bb10..50e1f8874 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -1,5 +1,5 @@ <app-post-header /> -<div class="section-container news"> +<div class="section-container news" role="tabpanel" id="posts"> <div *ngIf="!isLoading && allPosts.length === 0"> <p>Aucun résultat ne correspond à votre recherche.</p> </div> -- GitLab