reactjs / reactjs/react-tabs

Accessibility Bug - Duplicate Ids Created When More Than One Instance of the Tabs Is Used on a Page

Offen
#327 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
JavaScript
Sterne
3.1k
Forks
455
Ø Merge
5 Std. 9 Min.
Gemergte PRs (30 T.)
2

Beschreibung

This is an accessibility bug caused by the same id being used multiple times in the DOM. What react-tabs does to cause this bug is it autogenerates ids for the tabs it renders to the page. The ids start at 0, and are incremented for each tab and tab-panel rendered. This wouldn’t be a problem if the control is only used once, but when it's used more than once in your project, the separate instances of the control do not know about each other and so the ids for each instance of the control start at 0 and get incremented in the same way, causing id overlap. Ways this issue could be resolved: use random ids, require an instance of the tabs control to be given an id and use that id in the ids of the autogenerated ids for the tabs and tab panels.

By the way, I have made sure that I am using the most up to date version of react-tabs as of the time of writing this, 3.1.0.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Problem mit zwei Instanzen des react-tabs-Steuerelements auf einer Seite zu reproduzieren und die generierten Tab- und Tab-Panel-IDs im DOM zu untersuchen. Vergleiche die doppelten IDs und ihre Zuordnungen und ziehe dann die vorgeschlagenen Ansätze des Issues in Betracht; abgeschlossen ist die Aufgabe, wenn mehrere Instanzen eindeutige IDs haben und für die Barrierefreiheit weiterhin korrekt verknüpft sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, react
Bereich
accessibility, frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.