react / react/react-native

a11y(iOS): nested `<Text role="link" />` not focusable on iOS

Đang mở
#53,243 3 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Needs: Triage :mag: Platform: iOS
Ngôn ngữ chính
C++
Star
127k
Fork
25.3k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
4

Mô tả

Description

<Text role="link" /> element nested in <Text /> is not focusable by screen reader on iOS.

Example code
<Text style={styles.text}>
  Regular Text
  <Text role="link" onPress={handlePress}>Link Text</Text>
</Text>

On iOS it focuses only the top-level Text element, there is no focus on child text element with link role.

on Android it focuses first on top-level Text element (announcing: "contains links"), then focuses on child text element with link role.

This is especially hard to solve, if I would want to have 2+ links inside the text.

Steps to reproduce
  1. Clone https://github.com/mdjastrzebski/ReproLinkText
  2. Run under screen reader on iOS (& Android for comparison)
React Native Version

0.81.0

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
info Fetching system and libraries information...
System:
  OS: macOS 15.6
  CPU: (11) arm64 Apple M3 Pro
  Memory: 183.14 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.17.1
    path: ~/.nvm/versions/node/v22.17.1/bin/node
  Yarn:
    version: 3.6.4
    path: ~/.nvm/versions/node/v22.17.1/bin/yarn
  npm:
    version: 10.9.2
    path: ~/.nvm/versions/node/v22.17.1/bin/npm
  Watchman:
    version: 2025.07.28.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/mdj/.rbenv/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:
    API Levels:
      - "35"
      - "36"
    Build Tools:
      - 35.0.0
      - 36.0.0
    System Images:
      - android-35 | Google Play ARM 64 v8a
      - android-36 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.25410.109.2511.13752376
  Xcode:
    version: 16.4/16F6
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.16
    path: /usr/bin/javac
  Ruby:
    version: 3.4.5
    path: /Users/mdj/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.81.0
    wanted: 0.81.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: false
Stacktrace or Logs
N/A
MANDATORY Reproducer

https://github.com/mdjastrzebski/ReproLinkText

Screenshots and Videos

iOS (incorrect):
https://github.com/user-attachments/assets/623b4a6d-2ba2-4a7d-a659-7f16386c7ca2

Android (correct):
https://github.com/user-attachments/assets/216921f8-6f59-4261-b75f-574a7cb1de0e

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với trình tái hiện ReproLinkText bắt buộc và chạy nó bằng VoiceOver trên iOS, so sánh hành vi Text lồng nhau của nó với Android. Truy vết điểm truy cập accessibility của React Native Text liên quan đến các phần tử role="link" lồng nhau; được xem là hoàn tất khi link con nhận được focus trên iOS, bao gồm cả trường hợp có nhiều link, trong khi hành vi hiện có trên Android vẫn được giữ nguyên.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
ios, react-native, typescript
Lĩnh vực
accessibility, mobile
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.