react / react/react-native

hitSlop does not surface to Android TalkBack

オープン
#54,187 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Issue: Author Provided Repro Platform: Android
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

Description

Hey folks, looks like this long standing issue is still a problem: https://github.com/facebook/react-native/issues/32089. It was closed years ago, but the issue remains. I've made a new reproducer with React Native 0.82 and recorded demos.

hitSlop does not surface its information to TalkBack on Android. It works as I would expect it to with VoiceOver on iOS.

Steps to reproduce
  1. Install the reproducer application on Android
  2. With TalkBack off, open the app and use the two buttons. There is a blue button with no hitSlop, it will show an alert.
  3. There is a red button with 100 units of hitSlop. Tap the button itself, and its hitslop area. In both cases, you'll see an alert.
  4. Now enable TalkBack. Personally, I like keeping the shortcut enabled (there are directions in this link) to toggle back and forth.
  5. Attempt to select the top button. You'll see you can only focus it if you tap directly in it.
  6. Attempt to select the bottom button. Again, you can only focus it if you tap directly in it. The hitSlop is no longer working.

To me, this means users with assistive technologies can't benefit from the wider touch targets. That means if I'm trying to expand my touch target specifically to improve accessibility (say I have a small visual element but want to give it a more reasonable touch target), the accessibility is degraded when the user enables TalkBack.

I would expect the hitSlop amount to apply to the TalkBack selection as well. And in fact, it behaves that way on iOS. You can repeat those steps on iOS and use VoiceOver to see the hitSlop works in this scenario.

React Native Version

0.82.0

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info
HitSlop git:(main) ✗ npx @react-native-community/cli info
info Fetching system and libraries information...
System:
  OS: macOS 15.7.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 120.55 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.12.0
    path: /Users/tyler.williams/.asdf/installs/nodejs/22.12.0/bin/node
  Yarn:
    version: 4.6.0
    path: /Users/tyler.williams/.asdf/installs/nodejs/22.12.0/bin/yarn
  npm:
    version: 10.9.0
    path: /Users/tyler.williams/.asdf/plugins/nodejs/shims/npm
  Watchman:
    version: 2025.04.14.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/tyler.williams/.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.5
      - iOS 18.5
      - macOS 15.5
      - tvOS 18.5
      - visionOS 2.5
      - watchOS 11.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.26094.121.2513.14007798
  Xcode:
    version: 16.4/16F6
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /Users/tyler.williams/.asdf/shims/javac
  Ruby:
    version: 3.3.0
    path: /Users/tyler.williams/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.1.1
    wanted: 19.1.1
  react-native:
    installed: 0.82.0
    wanted: 0.82.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
N/A - this is a behavior problem, no error message.
MANDATORY Reproducer

https://github.com/coolsoftwaretyler/HitSlop-Accessibility-Bug-Reproducer

Screenshots and Videos

Here are two reproduction videos. I ran these on physical devices so I didn't get the taps recorded, but you should be able to reproduce the issue with the reproducer app and see what's going on.

Android

The TalkBack audio didn't come through Zoom but you'll still be able to see the problem by observing the focus.

https://github.com/user-attachments/assets/2ba7a653-1a9b-4330-a6f8-ec9b2238e796

iOS

https://github.com/user-attachments/assets/c9696e50-0698-4880-b656-361fa8f698ac

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、TalkBackを有効にしたAndroidで、リンクされているHitSlop-Accessibility-Bug-Reproducerを実行し、記載された手順に従って、iOS VoiceOverの動作と比較します。reproducerを起点に、AndroidでのhitSlopとaccessibility focusの処理を追跡します。完了の条件は、VoiceOverと同じように、TalkBackで拡張されたhitSlop領域を選択できることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, react-native
領域
accessibility, mobile-dev
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。