react / react/react-native

VoiceOver: Focus Returns to First Element Instead of Trigger Button After Closing Modal on iOS

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

还没有人认领这个 Issue。

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

描述

Description

When VoiceOver is enabled on an iOS device, closing a modal by clicking the cancel button causes the focus to shift back to the first element of the screen instead of the button that triggered the modal. This issue negatively impacts the user experience for visually impaired users who rely on VoiceOver for navigation.

Steps to reproduce
  1. Ensure VoiceOver is enabled on the iOS device.
  2. Open the React Native application.
  3. Navigate to the screen that includes a header, body, and a button at the bottom of the screen.
  4. Click the button at the bottom of the screen to open the modal.
  5. Within the modal, click the cancel button to close the modal.
  6. Observe the focus behavior once the modal is closed.
React Native Version

0.74

Affected Platforms

Runtime - iOS

Output of npx react-native info
System:
    OS: macOS 13.6.5
    CPU: (8) arm64 Apple M1
    Memory: 121.14 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.7.1 - /opt/homebrew/bin/node
    Yarn: 1.22.22 - ~/Desktop/project/sqh.projectorange.reactnative/node_modules/.bin/yarn
    npm: 10.5.0 - /opt/homebrew/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.15.2 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK: Not Found
  IDEs:
    Android Studio: 2022.2 AI-222.4459.24.2221.10121639
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.15 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.15 => 0.71.8 
    react-native-macos: Not Found
Stacktrace or Logs
Since this issue is related to accessibility focus behavior, It will not generate any traditional error logs or stack traces.
Reproducer

https://github.com/akashsquare/accessibility_poc
https://snack.expo.dev/@akshay-sqh/accessibility-poc

Screenshots and Videos

https://github.com/facebook/react-native/assets/58284589/4002cdda-27f8-4a37-9bd6-686c27ac47ce

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先,在启用 VoiceOver 的 iOS 上运行 React Native 0.74 中链接的 reproducer accessibility_poc,然后按照列出的 modal 和取消按钮步骤操作。确认关闭 modal 后观察到的 focus 目标,并将其与预期行为进行比较:focus 应返回到打开它的按钮。没有指定 source file 或 test,因此定位相关的 modal 和 accessibility-focus 处理也是调查的一部分。

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

评估

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

把新 issue 发到你的邮箱

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