patternfly / patternfly/patternfly-react

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

Abierto
#9,802 9 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

A11y Stale
Lenguaje dominante
TypeScript
Estrellas
862
Forks
392
Merge medio
4 d 8 h
PR fusionados (30 d)
9

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza en el punto de entrada del componente JumpLinks y revisa el manejo existente de label y aria-label. Sigue cómo llegan las props al wrapper de label y a nav, y verifica después que la compatibilidad con aria-labelledby, el id de label generado y la advertencia sobre la ausencia de un nombre accesible cumplen con lo indicado en el issue; la documentación de accesibilidad de la PatternFly org queda como trabajo de seguimiento.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
react, typescript
Área
accessibility, frontend
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
52/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.