react / react/react-native

[iOS] `accessibilityElementsHidden` does not work if the parent view is `accessible`

未关闭
#46,098 4 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Issue: Author Provided Repro Platform: iOS
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

When a parent view has the accessible prop set, VoiceOver reads all the text nodes and accessibility labels of its children even if one of them has a parent with the accessibilityElementsHidden / aria-hidden prop set.

Steps to reproduce
  1. Open the Expo Snack on an iOS device with Expo Go.
  2. Enable VoiceOver (triple press on the power button, if enabled in the settings. Otherwise enable it in Settings > Accessibility > VoiceOver).
  3. Verify that VoiceOver reads all three lines in both cases when it should only read "First layout" in the second one, like TalkBack on Android does.
React Native Version

0.74.5

Affected Platforms

Runtime - iOS

Output of npx react-native info
System:
  OS: macOS 14.6.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 536.33 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /opt/homebrew/bin/zsh
Binaries:
  Node:
    version: 21.6.1
    path: ~/.local/share/mise/installs/node/21.6.1/bin/node
  Yarn:
    version: 1.22.21
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.2.4
    path: ~/.local/share/mise/installs/node/21.6.1/bin/npm
  Watchman:
    version: 2024.03.18.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/valou/.local/share/mise/installs/ruby/3.2.3/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11255304
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /Users/valou/.local/share/mise/installs/java/adoptopenjdk-17.0.10+7/bin/javac
  Ruby:
    version: 3.2.3
    path: /Users/valou/.local/share/mise/installs/ruby/3.2.3/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.5
    wanted: 0.74.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Stacktrace or Logs
N/A
Reproducer

https://snack.expo.dev/@vbriand/voiceover-accessible-bug

Screenshots and Videos

https://github.com/user-attachments/assets/50c266e2-7906-4c31-b138-090f0038abf1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从链接的 Expo Snack 开始,使用 VoiceOver 在 iOS 上复现该行为,重点关注 accessible 与 accessibilityElementsHidden/aria-hidden 之间的交互。将结果与 Android 上的 TalkBack 进行比较,并跟踪其中涉及的 React Native iOS 无障碍处理。完成标准是:隐藏嵌套内容时,VoiceOver 只读出“First layout”,同时保留现有的 accessible 父元素行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
react-native
领域
accessibility, mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。