Skip to content

Commit 8d542de

Browse files
authored
Merge pull request #982 from dnum-mi/fix/rgaa
Fix: 🐛 Amélioration de quelques composants suite audit RGAA
2 parents 14796f1 + d47d61c commit 8d542de

File tree

6 files changed

+31
-10
lines changed

6 files changed

+31
-10
lines changed

src/components/DsfrBreadcrumb/DsfrBreadcrumb.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ watch(expanded, (newValue, oldValue) => {
4242
:aria-label="navigationLabel"
4343
>
4444
<button
45-
v-show="!expanded"
45+
v-if="!expanded"
4646
class="fr-breadcrumb__button"
4747
:aria-expanded="expanded"
4848
:aria-controls="breadcrumbId"

src/components/DsfrFooter/DsfrFooter.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ const externalOperatorLink = computed(() => {
240240
:to="isExternalLink ? undefined : routerLinkLicenceTo"
241241
:href="isExternalLink ? aLicenceHref : undefined"
242242
:target="isExternalLink ? '_blank' : undefined"
243+
:title="isExternalLink ? `${licenceName} (nouvelle fenêtre)` : licenceName"
243244
rel="noopener noreferrer"
244245
v-bind="licenceLinkAttrs"
245246
>

src/components/DsfrHeader/DsfrHeader.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const props = withDefaults(defineProps<DsfrHeaderProps>(), {
2828
quickLinksAriaLabel: 'Menu secondaire',
2929
showSearchLabel: 'Recherche',
3030
menuLabel: 'Menu',
31-
menuModalLabel: 'Menu modal',
31+
menuModalLabel: 'Menu',
3232
closeMenuModalLabel: 'Fermer',
3333
homeLabel: 'Accueil',
3434
})
@@ -68,7 +68,10 @@ const showMenu = () => {
6868
modalOpened.value = true
6969
menuOpened.value = true
7070
searchModalOpened.value = false
71-
document.getElementById('close-button')?.focus()
71+
// Sans le setTimeout, le focus n'est pas fait
72+
setTimeout(() => {
73+
document.getElementById('close-button')?.focus()
74+
})
7275
}
7376
const showSearchModal = () => {
7477
modalOpened.value = true
@@ -142,7 +145,7 @@ provide(registerNavigationLinkKey, () => {
142145
class="fr-btn--menu fr-btn"
143146
:data-fr-opened="showMenu"
144147
aria-controls="header-navigation"
145-
aria-haspopup="menu"
148+
aria-haspopup="dialog"
146149
:aria-label="menuLabel"
147150
:title="menuLabel"
148151
data-testid="open-menu-btn"

src/components/DsfrModal/DsfrModal.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ const iconProps = computed(() => dsfrIcon.value
9494
<dialog
9595
id="fr-modal-1"
9696
ref="modal"
97+
aria-modal="true"
9798
:aria-labelledby="modalId"
9899
:role="role"
99100
class="fr-modal"

src/components/DsfrTable/DsfrTable.vue

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import DsfrTableRow, { type DsfrTableRowProps } from './DsfrTableRow.vue'
66
import type { DsfrTableProps } from './DsfrTable.types'
77
import {getRandomId} from "@/utils/random-utils";
88
9+
import { getRandomId } from '@/utils/random-utils'
10+
911
export type { DsfrTableProps }
1012
1113
const props = withDefaults(defineProps<DsfrTableProps>(), {
@@ -24,6 +26,7 @@ const getRowData = (row: DsfrTableProps['rows']) => {
2426
}
2527
2628
const currentPage = ref(props.currentPage)
29+
const selectId = getRandomId()
2730
const optionSelected = ref(props.resultsDisplayed)
2831
const pageCount = computed(() =>
2932
props.rows.length > optionSelected.value
@@ -109,6 +112,7 @@ const selectId = getRandomId('resultPerPage')
109112
<select
110113
:id="selectId"
111114
v-model="optionSelected"
115+
title="Résultats par page - le nombre résultats est mis à jour dès sélection d’une valeur"
112116
@change="emit('update:currentPage')"
113117
>
114118
<option
@@ -120,26 +124,37 @@ const selectId = getRandomId('resultPerPage')
120124
</option>
121125
</select>
122126
</div>
123-
<div class="flex ml-1">
124-
<span class="self-center">Page {{ currentPage }} sur {{ pageCount }}</span>
127+
<div class="flex ml-1"
128+
aria-live="polite"
129+
aria-atomic="true"
130+
>
131+
<p class="self-center fr-m-0">Page {{ currentPage }} sur {{ pageCount }}</p>
125132
</div>
126133
<div class="flex ml-1">
127134
<button
128135
class="fr-icon-arrow-left-s-first-line"
129136
@click="goFirstPage()"
130-
/>
137+
>
138+
<span class="fr-sr-only">Première page du tableau</span>
139+
</button>
131140
<button
132141
class="fr-icon-arrow-left-s-line"
133142
@click="goPreviousPage()"
134-
/>
143+
>
144+
<span class="fr-sr-only">Page précédente du tableau</span>
145+
</button>
135146
<button
136147
class="fr-icon-arrow-right-s-line"
137148
@click="goNextPage()"
138-
/>
149+
>
150+
<span class="fr-sr-only">Page suivante du tableau</span>
151+
</button>
139152
<button
140153
class="fr-icon-arrow-right-s-last-line"
141154
@click="goLastPage()"
142-
/>
155+
>
156+
<span class="fr-sr-only">Dernière page du tableau</span>
157+
</button>
143158
</div>
144159
</div>
145160
</td>

src/composables/useCollapsable.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export const useCollapsable = () => {
5454
*/
5555
const onTransitionEnd = (expanded: boolean): void => {
5656
collapsing.value = false
57+
collapse.value?.querySelector('a')?.focus()
5758
if (collapse.value && expanded === false) {
5859
collapse.value.style.removeProperty('--collapse-max-height')
5960
}

0 commit comments

Comments
 (0)