-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A11Y: Amélioration de l'accessibilité des tooltip #5380
base: master
Are you sure you want to change the base?
Conversation
La doc de bootstrap dit:
Est-ce qu’on ne devrait pas changer le markup pour suivre ces recommendations ? |
26100be
to
e20826a
Compare
Pour les |
29b2a62
to
3d03510
Compare
itou/templates/admin/job_applications/jobapplication_change_form.html
Outdated
Show resolved
Hide resolved
62d9f78
to
a9781e7
Compare
4454f80
to
2ccf1c8
Compare
🥁 La recette jetable est prête ! 👉 Je veux tester cette PR ! |
2ccf1c8
to
068bfbb
Compare
068bfbb
to
f8bd32c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
La meilleure accessibilité pour les tooltips est de les retirer...
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tooltip_role
À discuter avec les UX, mais j’ai l’impression qu’on continue d’en ajouter.
data-bs-toggle="tooltip" | ||
data-bs-placement="left" | ||
data-bs-html="true" | ||
data-bs-title="Une relance sera envoyée 3 jours après. <br> Vous pourrez renvoyer une invitation sous 10J."></i> | ||
data-bs-title="Une relance sera envoyée 3 jours après. <br> Vous pourrez renvoyer une invitation sous 10J." | ||
role="button" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi ne pas utiliser un bouton avec text-success
ici ?
<strong>Une autre structure</strong> | ||
</a> | ||
{% else %} | ||
<div data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Vous devez d’abord décliner la candidature pour pouvoir la transférer à un autre employeur"> | ||
<div data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Vous devez d’abord décliner la candidature pour pouvoir la transférer à un autre employeur" role="button" tabindex="0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ce dropdown me semble complètement inaccessible au clavier ?
Peut-être qu’une fois son markup corrigé (dans une autre PR), on pourrait en profiter pour utiliser un bouton ici ?
@@ -93,16 +93,18 @@ <h2 class="h4">Candidatures</h2> | |||
{% if export_for == "siae" %} | |||
<a class="btn btn-sm btn-link btn-ico-only" | |||
{% matomo_event "candidature" "exports" "export-siae" %} | |||
aria-label="Télécharger cet export SIAE au format .xlsx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi déplacer le aria-label sur le <i>
? C’est bien le lien qui déclenche le téléchargement, pas l’icone à l’intérieur.
(tous le fichier)
{% elif radio.data.value == RefusalReason.NO_POSITION %} | ||
{{ radio.choice_label }} | ||
<i class="ri-information-line ri-lg text-info ms-1" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="Si vous choisissez ce motif, les fiches de postes associées seront dépubliées."></i> | ||
<button type="button" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="Si vous choisissez ce motif, les fiches de postes associées seront dépubliées."> | ||
<i class="ri-information-line ri-lg text-info ms-1" aria-label="Si vous choisissez ce motif, les fiches de postes associées seront dépubliées."></i> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J’ai l’impression que ce tooltip ne devrait pas en être un. Le aria-label décrit l’élément <i>
, ce qui n’est pas vraiment ce qu’on veut. Ni le bouton d’ailleurs.
<i class="ri-information-line ri-xl text-info" | ||
data-bs-toggle="tooltip" | ||
data-bs-title="Cette date de fin est susceptible d’évoluer avec les éventuelles suspensions et prolongations du PASS IAE." | ||
role="button" | ||
tabindex="0"> | ||
</i> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
axeDevTools n’est pas heureux avec ce markup.
https://dequeuniversity.com/rules/axe/4.10/aria-command-name?application=AxeFirefox
To solve this problem, you need to fix at least (1) of the following:
L’élément n’a aucun contenu textuel visible par les lecteurs d’écran
L’attribut aria-label n’existe pas ou est vide
L’attribut aria-labelledby n’existe pas, fait référence à des éléments qui n’existent pas ou à des éléments vides ou non visibles
L’élément n’a pas d’attribut title
{% else %} | ||
<a href="{% url 'apply:start_hire' company_pk=request.current_organization.pk %}" class="btn btn-lg btn-primary btn-ico" {% matomo_event "employeurs" "clic" "declarer-embauche" %}> | ||
<i class="ri-user-follow-line fw-medium"></i> | ||
<i class="ri-user-follow-line fw-medium" aria-hidden="true"></i> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J’ai l’impression qu’on pourrait faire une passe plus globale sur les icônes pour ajouter aria-hidden="true"
partout.
@@ -23,7 +23,9 @@ | |||
<td> | |||
{{ member.user.get_full_name }} | |||
{% if member.user in active_admin_members %} | |||
<span class="badge badge-xs rounded-pill bg-info" data-bs-toggle="tooltip" data-bs-title="Administrateur de la structure">admin</span> | |||
<button type="button" class="badge badge-xs rounded-pill bg-info" data-bs-toggle="tooltip" data-bs-title="Administrateur de la structure"> | |||
admin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je me demande si on ne voudrait pas ajouter un <span class="visually-hidden">inistrateur</span>
ou équivalent pour que les lecteurs d’écran n’emploient pas l’abbréviation ?
<a href="{% url base_url|add:":update_admin_role" "add" member.user.pk %}" class="dropdown-item">Ajouter en tant qu'administrateur</a> | ||
{% else %} | ||
<a href="{% url base_url|add:":update_admin_role" "remove" member.user.pk %}" class="dropdown-item"> | ||
Retirer les droits d'administrateur | ||
</a> | ||
<a href="{% url base_url|add:":update_admin_role" "remove" member.user.pk %}" class="dropdown-item">Retirer les droits d'administrateur</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ces lignes n’ont pas été changées, serait-il possible de les laisser dans leur état d’origine ?
🤔 Pourquoi ?
Les tooltips ne sont pas toujours activables à la tabulation
🍰 Comment ?
data-bs-toggle="tooltip"
sur les<a>
qui enroberaient un<i data-bs-toggle="tooltip">
<span>
ou<div>
possédant undata-bs-toggle="tooltip"
par des quand c'était possible et en ajoutant sur unrole="button"
ettabindex="0"
quand ça ne l'était pas💻 Captures d'écran
Avant
Apres