Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] [New Architecture 0.73.6] Missing accessibilityLabel Text and Switch Component #43648

Open
renopp opened this issue Mar 26, 2024 · 1 comment
Labels
Component: Switch Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@renopp
Copy link

renopp commented Mar 26, 2024

Description

There is an issue with rendering the Text and Switch components with custom accessibilityLabel on the iOS platform with new architecture enabled. It seems like the accessibilityLabel props not passing properly. However, there is no problem on the Android platform with new architecture enabled.

Screenshot 2024-03-26 at 11 23 05 Screenshot 2024-03-26 at 11 23 17

Steps to reproduce

  1. yarn install
  2. yarn start
  3. yarn ios
  4. After the app installed successfully open Xcode then go to menu Xcode -> Open Developer Tool -> Accessibility Inspector

React Native Version

0.73.6

Affected Platforms

Runtime - iOS

Areas

Fabric - The New Renderer

Output of npx react-native info

System:
  OS: macOS 13.5.2
  CPU: (8) arm64 Apple M1 Pro
  Memory: 84.02 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.10.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.yarn/bin/yarn
  npm:
    version: 8.12.1
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2023.12.04.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11255304
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/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: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

no stacktrace

Reproducer

https://github.com/renopp/accessibilityLabel-issue

Screenshots and Videos

No response

@renopp renopp added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Mar 26, 2024
@gedeagas
Copy link
Contributor

Hello @renopp ,

Thank you for reporting this issue. Indeed, it appears to be a bug, and currently, there doesn't seem to be a quick workaround.

With the new architecture in iOS, the testID is now being mapped to the accessibilityIdentifier of a native component. Previously, it was mapped to the accessibilityLabel. This change has led to a situation where automated testing tools like Appium are unable to find elements using accessibilityLabel.

At the moment, it seems the only viable solution for iOS is to refactor your automated tests to use accessibilityIdentifier.

For related issues, please see: #38709

Unfortunately, I don't believe the React Native core team has a clear timeline for addressing this issue right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Switch Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

3 participants