Projet

Général

Profil

Development #85003

améliorer l'accessibilité des section/foldable

Ajouté par Frédéric Péters il y a 4 mois. Mis à jour il y a 4 mois.

Statut:
Nouveau
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
21 décembre 2023
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

Le code dans w.c.s. contient une gestion de l'accessibilité que ne contient pas gadjo, (tabindex, role bouton, clavier, aria-expanded),

  $('.section.foldable > h2 [role=button]').each(function() {
     $(this).attr('tabindex', '0');
  });
  $('.section.foldable > h2 [role=button]').on('keydown', function(ev) {
    if (ev.keyCode == 13 || ev.keyCode == 32) {  // enter || space
      $(this).trigger('click');
      return false;
    }
  });
  $('.section.foldable > h2').off('click').click(function() {
     var folded = $(this).parent().hasClass('folded');
     var $button = $(this).find('[role=button]').first();
     if ($button.length) {
       $button[0].setAttribute('aria-expanded', `${folded}`);
     }
     $(this).parent().toggleClass('folded');
     ...

Formats disponibles : Atom PDF