react / react/react-native

[Accessibility] [TalkBack] PanResponder callbacks do not fire when TouchableOpacity/Pressable is pressed and TalkBack is on

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

还没有人认领这个 Issue。

API: PanResponder Component: TouchableOpacity Issue: Author Provided Repro Newer Patch Available
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

On Android with TalkBack on, TouchableOpacity/Pressable components do not trigger PanResponder callbacks when pressed if the TouchableOpacity/Pressable has on onPress prop and its focusable prop is not false.

Steps to reproduce
  1. Create a PanResponder and apply its panHandlers to a View.
  2. Add a Pressable inside the View and give it an onPress prop.
  3. View the app in Android with TalkBack on.
  4. Double-tap to activate, observe the pan responder callbacks DO NOT fire.

Furthermore, double-tapping a non-TouchableOpacity/Pressable element such as a Text component will trigger PanResponder callbacks.

In the example repo I provided it should print "PanResponder Callback Triggered' but its only printing "ON PRESS TRIGGERED"

React Native Version

0.73.6

Affected Platforms

Runtime - Android

Output of npx react-native info
System:
  OS: macOS 14.5
  CPU: (11) arm64 Apple M3 Pro
  Memory: 84.00 MB / 18.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.18.0
    path: ~/.nvm/versions/node/v18.18.0/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 9.8.1
    path: ~/.nvm/versions/node/v18.18.0/bin/npm
  Watchman:
    version: 2024.04.22.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    API Levels:
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
      - "33"
      - "34"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-28 | Google ARM64-V8a Play ARM 64 v8a
      - android-29 | Google Play ARM 64 v8a
      - android-31 | Google APIs ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.1 AI-221.6008.13.2211.9514443
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /Library/Java/JavaVirtualMachines/jdk-17.0.10.jdk/Contents/Home/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: 0.73.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
Stacktrace or Logs
No Stacktrace or log
Reproducer

https://github.com/Abhisflyingsoon/android-panresponder-accessibility

Screenshots and Videos

No response

贡献指南

打开贡献指南

从这里开始

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

调研方向

从链接的 reproducer 开始,在启用 TalkBack 的 Android 上,使用所述的 PanResponder、Pressable 和 TouchableOpacity 场景重现该问题。跟踪从 TalkBack 激活开始,经由 Pressable 或 TouchableOpacity,到 PanResponder 回调的交互过程。当 PanResponder 回调在报告的场景中触发,同时 onPress 回调继续正常工作时,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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