patternfly / patternfly/patternfly-react

JumpLinks - add aria-labelledby prop and warning for aria labels

Ouverte
#9,802 9 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

A11y Stale
Langage dominant
TypeScript
Étoiles
862
Forks
392
Merge moyen
4 j 8 h
PR mergées (30 j)
9

Description

Is this a new component or an extension of an existing one?
JumpLinks

Describe the feature
Follow up to comments in https://github.com/patternfly/patternfly-org/pull/3808

Basically right now the default value of the aria-label on JumpLinks is set to the label prop if passed in, and only if label is a string. Ideally we should consider making updates so that:

  • an aria-labelledby prop can be passed in which can be given an id of the label element or some other element that labels the jump links nav.

  • if label is not a string and aria-labelledby is not manually passed in, generate a random id internally that's applied to the label wrapper element (pf-v5-c-jump-links__label), with that id passed to an aria-labelledby attribute on the outer JumpLinks nav element.

  • We could also consider removing the default value of the aria-label prop, but that may need to wait for a breaking change. Rationale here is that it would make more sense to link to the visible text label via aria-labelledby rather than repeat the text in an aria-label; while React is automating that for the consumer, it's only when the label prop is a string and in the HTML implementation there isn't that same automation provided by us

We should also add in a console warning if neither aria-label or aria-labelledby are passed in, otherwise there's a chance that the JumpLinks internal nav has no proper accessible name.

Are there visuals for this feature? If applicable, please include examples for each state and for varying widths
Include screenshots or links to Marvel or other mockups.

Any other information?
A followup will need to be made in org to add verbiage to the a11y docs for JumpLinks


Jira Issue: PF-109

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par le point d’entrée du composant JumpLinks et examinez la gestion existante de label et aria-label. Suivez la manière dont les props parviennent au wrapper de label et à nav, puis vérifiez que la prise en charge de aria-labelledby, l’id de label généré et l’avertissement concernant l’absence de nom accessible répondent aux exigences de l’issue ; la documentation d’accessibilité de la PatternFly org reste un élément de suivi.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
react, typescript
Domaine
accessibility, frontend
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
52/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.