patternfly / patternfly/patternfly-react
JumpLinks - add aria-labelledby prop and warning for aria labels
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 862
- フォーク
- 392
- 平均マージ
- 4日 8時間
- マージ済み PR(30日)
- 9
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
JumpLinks コンポーネントのエントリポイントから始め、既存の label と aria-label の処理を確認します。props が label wrapper と nav にどのように渡るかを追跡し、aria-labelledby のサポート、生成される label id、アクセシブルネームがない場合の警告が issue の要件を満たしていることを確認します。PatternFly org のアクセシビリティドキュメントは引き続きフォローアップとします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react, typescript
- 領域
- accessibility, frontend
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100