react / react/react-native

VoiceOver focus order breaks when UI is updated asynchronously

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

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

Needs: Triage :mag:
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

Description

When UI is updated from some asynchronous call like setTimeout, it seems the focus order of elements on the screens becomes broken (even when that focus order is correct before the UI change). The focus order jumps outside of the app (into the OS status bar, it seems?) and becomes trapped.

This seems like it may be related to https://github.com/react/react-native/issues/49462, but there are a few important differences I want to focus on:

  1. No keyboard behavior at all.
  2. This is not a problem that needs to be solved with custom focus order: the focus order is originally correct in a simple screen, but breaks when UI is changed from a setTimeout (I'm assuming it has something to do with being an async UI update, but I haven't discovered enough details yet to back up that claim)
Steps to reproduce
  1. Install the reproducer on an iPhone device
  2. Open the application
  3. Turn on VoiceOver
  4. Walk through the screen. The focus order should work as you'd expect (goes down the screen in-order as elements are written)
  5. Move the focus back up to the "A" button and double tap to use it. UI is updated
  6. Move focus down the screen to the "B" button. It should work as it did in your first pass.
  7. Double tap the "B" button, wait for text to update to "2 new messages"
  8. Swipe to move focus down. Now you'll notice a few issues:

First issue: we read out the stale "checking for new messages" text, which is no longer visible if you waited for the messages to be checked and resolve to "2 new messages"

Second issue: if you try to move focus past "2 new messages" by swiping right, your focus jumps up to the top of the screen, and then you can't get out of it by swiping left or right.

React Native Version

0.87.0

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
System:
  OS: macOS 26.6.2
  CPU: (16) arm64 Apple M3 Max
  Memory: 500.75 MB / 48.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.2.0
    path: /Users/tylerwilliams/.asdf/installs/nodejs/24.2.0/bin/node
  Yarn:
    version: 1.22.22
    path: /Users/tylerwilliams/.asdf/shims/yarn
  npm:
    version: 11.3.0
    path: /Users/tylerwilliams/.asdf/installs/nodejs/24.2.0/bin/npm
  Watchman:
    version: 2026.05.11.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/tylerwilliams/.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.5
      - iOS 26.5
      - macOS 26.5
      - tvOS 26.5
      - visionOS 26.5
      - watchOS 26.5
  Android SDK:
    API Levels:
      - "31"
      - "34"
      - "35"
      - "36"
      - "36"
      - "37"
    Build Tools:
      - 30.0.3
      - 33.0.1
      - 34.0.0
      - 35.0.0
      - 36.0.0
      - 37.0.0
    System Images:
      - android-29 | Google Play ARM 64 v8a
      - android-31 | Google APIs ARM 64 v8a
      - android-32 | Google Play ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
      - android-35 | Google Play ARM 64 v8a
      - android-36.1 | Google Play ARM 64 v8a
      - android-36 | Google Play ARM 64 v8a
      - android-37.1 | 16 KB Page Size Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2026.1 AI-261.26222.65.2613.15948027
  Xcode:
    version: 26.6/17F113
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 3.3.4
    path: /Users/tylerwilliams/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.2.0
    wanted: 20.2.0
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.87.0
    wanted: 0.87.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
No stack trace or log, it's not a crash or failure, just incorrect behavior.
MANDATORY Reproducer

https://github.com/coolsoftwaretyler/focusissues

Screenshots and Videos

https://github.com/user-attachments/assets/9506a48b-7ac4-4728-8908-1148aeb7ad07

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

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

はじめの一歩

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

調査の方向性

まず、VoiceOver を有効にした iPhone に https://github.com/coolsoftwaretyler/focusissues の必須の再現手順をインストールして実行し、その後、一覧に記載された手順に従って、非同期更新後に古いテキストが表示され、フォーカスが閉じ込められることを確認します。更新されたテキストが読み上げられ、そのテキストをスワイプして通過したときに、アプリの外へ移動することなく期待されるフォーカス順序が維持されれば完了です。

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

評価

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

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

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