reactjs / reactjs/react-tabs

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

オープン
#327 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
JavaScript
スター
3.1k
フォーク
455
平均マージ
5時間 9分
マージ済み PR(30日)
2

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、1ページ上に react-tabs コントロールのインスタンスを2つ配置して問題を再現し、DOM に生成されたタブとタブパネルの ID を調べます。重複した ID とそれらの関連付けを比較し、そのうえで issue で提案されているアプローチを検討します。複数のインスタンスが一意の ID を持ち、アクセシビリティのために正しく関連付けられたままになれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, react
領域
accessibility, frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。