patternfly / patternfly/patternfly-react
Bug - MenuToggle - aria labelling doesn't work as intended
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 862
- フォーク
- 392
- 平均マージ
- 4日 8時間
- マージ済み PR(30日)
- 9
説明
Describe the problem
Per https://github.com/patternfly/patternfly/issues/6562, we need to update how aria labeling is handled in MenuToggle, namely:
-
Right now the aria-label on the MenuToggle does nothing since the text content is taking precedence,
-
We need to ensure MenuToggle's with dynamic text content have an accessible name that includes a static label as well as the dynamic toggle content
How do you reproduce the problem?
Go to a MenuToggle and Select example and navigate both with VoiceOver. Notice that only the text content gets announced. Then choose a new option in the Select example, and notice that there's no context for what the Select is actually for but rather just the current text content.
Expected behavior
Note this is most likely only for a non-typeahead and non-plain MenuToggle, basically only a MenuToggle whose content would be dynamic like in Select examples (where by default the toggle content may be "Choose an option", then choosing an option updates the toggle content to e.g. "Option 1").
-
MenuToggle should have an aria-labelledby on its internal
buttonelement that should reference thepf-v6-c-menu-toggle__button(if aria-label is passed; if aria-labelledby is passed to MenuToggle then this internal aria-labelledby should reference that ID instead) andpf-v6-c-menu-toggle__textelements -- this should only occur when aria-label or aria-labelledby are passed to MenuToggle -
We should add aria-labelledby to the props interface to explicitly expose it
-
Examples using MenuToggle must be updated so that there is a unique/descriptive static label as well as its content label
Using the single select example in React, here's what the markup should end up looking similar to:
Is this issue blocking you?
List the workaround if there is one.
Screenshots
If applicable, add screenshots to help explain the issue.
What is your environment?
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
What is your product and what release date are you targeting?
Any other information?
Jira Issue: PF-1729
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
MenuToggle の実装、その props インターフェース、および issue にリンクされている React Select の例を確認します。aria-label、aria-labelledby、動的なトグルテキストが現在どのようにレンダリングされているかを確認し、内部ボタンが必要なアクセシブルネームを持つようにコンポーネントと例を更新します。single-select の例と VoiceOver を使って、結果のマークアップを検証します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react, typescript
- 領域
- accessibility, frontend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 65/100