patternfly / patternfly/patternfly-react
JumpLinks - add aria-labelledby prop and warning for aria labels
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 862
- Fork
- 392
- Merge medio
- 4g 8h
- PR unite (30g)
- 9
Descrizione
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-labelledbyprop can be passed in which can be given anidof thelabelelement or some other element that labels the jump links nav. -
if
labelis not a string andaria-labelledbyis not manually passed in, generate a randomidinternally that's applied to thelabelwrapper element (pf-v5-c-jump-links__label), with thatidpassed to an aria-labelledby attribute on the outer JumpLinksnavelement. -
We could also consider removing the default value of the
aria-labelprop, 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 viaaria-labelledbyrather than repeat the text in anaria-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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dal punto di ingresso del componente JumpLinks e leggi la gestione esistente di label e aria-label. Segui il percorso delle props fino al wrapper di label e a nav, quindi verifica che il supporto per aria-labelledby, l’id di label generato e l’avviso relativo all’assenza di un nome accessibile soddisfino quanto richiesto dall’issue; la documentazione sull’accessibilità della PatternFly org resta un’attività successiva.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- react, typescript
- Ambito
- accessibility, frontend
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100