patternfly / patternfly/patternfly-react

Bug - Button - update aria-disabled logic to be more correct

Aperta
#11,618 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Breaking change :boom: PF Team
Lingua principale
TypeScript
Stelle
862
Fork
392
Merge medio
4g 8h
PR unite (30g)
9

Descrizione

Describe the problem
Followup to https://github.com/patternfly/patternfly-react/issues/11617 for breaking change release. We should update the logic of aria-disabled being applied. Currently aria-disabled is always set and is setup to basically match the disabled value (otherwise we end up with aria-disabled being false when disabled is true, which is contradictory and has potential to cause issue with AT – FWIW in limited testing it seems like disabled has priority, but should still be considered an issue).

Additionally, we were mixing the way to disable the Button depending on the component prop in https://github.com/patternfly/patternfly-react/pull/11478. Instead we should be more explicit that isDisabled should be used when a) the component is button, or b) the button doesn't need to be focusable for a tooltip or similar, and isAriaDisabled should be used when a) the component is anything other than button, or b) when the button is intended to be focusable/hoverable to trigger a Tooltip or similar.

Expected behavior
aria-disabled only renders when true, which matches how the disabled attribute gets rendered (only when true, not rendered when false), and aria-disabled must be set explicitly (rather than having isDisabled set it when component !== button).


Jira Issue: PF-2208

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

Inizia individuando il componente Button in TypeScript e la copertura esistente dei test di accessibilità. Esamina come vengono gestiti isDisabled, isAriaDisabled, component, disabled e aria-disabled, quindi verifica che aria-disabled venga sottoposto a rendering solo quando è esplicitamente impostato su true e che i casi documentati con elemento focalizzabile e non focalizzabile si comportino come previsto.

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à
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.