patternfly / patternfly/patternfly-react

Bug - MenuToggle - aria labelling doesn't work as intended

Aperta
#11,805 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

A11y PF Team Stale
Lingua principale
TypeScript
Stelle
862
Fork
392
Merge medio
4g 8h
PR unite (30g)
9

Descrizione

Describe the problem
Per https://github.com/patternfly/patternfly/issues/6562, we need to update how aria labeling is handled in MenuToggle, namely:

  • Right now the aria-label on the MenuToggle does nothing since the text content is taking precedence,

  • We need to ensure MenuToggle's with dynamic text content have an accessible name that includes a static label as well as the dynamic toggle content

How do you reproduce the problem?
Go to a MenuToggle and Select example and navigate both with VoiceOver. Notice that only the text content gets announced. Then choose a new option in the Select example, and notice that there's no context for what the Select is actually for but rather just the current text content.

Expected behavior
Note this is most likely only for a non-typeahead and non-plain MenuToggle, basically only a MenuToggle whose content would be dynamic like in Select examples (where by default the toggle content may be "Choose an option", then choosing an option updates the toggle content to e.g. "Option 1").

  • MenuToggle should have an aria-labelledby on its internal button element that should reference the pf-v6-c-menu-toggle__button (if aria-label is passed; if aria-labelledby is passed to MenuToggle then this internal aria-labelledby should reference that ID instead) and pf-v6-c-menu-toggle__text elements -- this should only occur when aria-label or aria-labelledby are passed to MenuToggle

  • We should add aria-labelledby to the props interface to explicitly expose it

  • Examples using MenuToggle must be updated so that there is a unique/descriptive static label as well as its content label

Using the single select example in React, here's what the markup should end up looking similar to:

image

Is this issue blocking you?
List the workaround if there is one.

Screenshots
If applicable, add screenshots to help explain the issue.

What is your environment?

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

What is your product and what release date are you targeting?

Any other information?


Jira Issue: PF-1729

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Individua l’implementazione di MenuToggle, la relativa interfaccia delle props e gli esempi di React Select collegati nell’issue. Controlla come vengono attualmente renderizzati aria-label, aria-labelledby e il testo dinamico del toggle, quindi aggiorna il componente e gli esempi in modo che il pulsante interno abbia il nome accessibile richiesto. Verifica il markup risultante con l’esempio single-select e VoiceOver.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
react, typescript
Ambito
accessibility, frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
65/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.