[a11y] `role` prop not fully supported on React Native
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- react-native
調査の方向性
リンクされている rsd-role-repro から始め、issue で説明されている View と Pressable のケースを比較し、role と accessible の props に注目してください。ネストされた View 要素を含め、iOS のスクリーンリーダーで動作を確認してください。非 pressable 要素で role の読み上げが機能し、親コントロールによって問題のあるネストされたアクセシビリティ要素を防止できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the issue
React Native requires accessible={true} prop to be set on View elements to announce role prop. However, the accessible prop is not exposed by RSD.
The only way in where role works correctly in RN with RSD is:
Textelements behave as ifaccessible={true}by default- When using
Pressable, it setsaccessible={true}on the rendererViewelement. UsingonPresshandler with RSD triggers usingPressableinstead of plainView.
These two cases are frequent enough that they avoid the problem in most cases, but unfortunately, not all.
A simple solution would be to have the role prop (perhaps excluding none/presentation) set accessible to true. However, that creates an issue in the iOS environment, which generally does not support nested accessibility elements. If there are two nested Views with accessible prop, only one is recognized (the ancestor one).
Expected behavior
There should be a way of controlling accessible prop. Perhaps a reasonable default would be to set it to true when role is not none/presentation. However, given the iOS issue described above, there should be a way to disable the status of accessibility element (on a parent), as it might prevent children from receiving a11y focus.
Steps to reproduce
- Render
<html.div role="heading">element, withoutonClickhandler. - Compare with the case when you set
onClickhandler, with rendersaccessibleprop throughPressablecomponent - Use a screen reader to navigate to the button
- Role is not being announced
https://github.com/user-attachments/assets/be386fe5-3a61-46fb-bd3c-00659801e6df
Notice the header role announced on elements with accessible prop, and not announced otherwise.
Test case
https://github.com/mdjastrzebski/rsd-role-repro
Additional comments
No response
- 主要言語
- JavaScript
- スター
- 3.6k
- フォーク
- 208
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react/react-strict-dom のほかの issue
-
Outline styles aren't parsed in React Native対応中かも @hoangvvo が 149 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
react/react-strict-dom#467 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
react/react-strict-dom#465 · コメント 2 件 ·
-
postcss plugin re-transforms every included file on each rebuild under Turbopack (minutes-long HMR in large projects)対応中かも @borisyankov が 18 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
react/react-strict-dom#520 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
react/react-strict-dom#505 · リアクション 2 件 ·
-
Button remains unclickable after disabled state changes対応中かも @MoOx が 132 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
react/react-strict-dom#491 · コメント 4 件 ·
react/react-strict-dom の issue をすべて見る
似ている issue
-
area/frontend good first issue kind/cooldown
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
kestra-io/kestra#20702 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Form-data fields are not parsed when importing a cURL request対応中かも @aayushbaluni が今日担当しました。 オープンbug status-new
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
メンテナーはふだん 1 日以内に返信
-
bug MVP
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
saayam-for-all/webapp#1911 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
vshulcz/deja-vu#4937 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[Focus] Accessibility (a11y) [Package] Grid [Type] Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信