facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.13k stars 24.32k forks source link

For iOS, the default Accessibility ID is set to the name of the UI element for textInput Element #37506

Closed chetnaag95 closed 11 months ago

chetnaag95 commented 1 year ago

Description

I have added same accessibility label for ios and android in react native. For Android, the value of Accessibility is the same as the value of the attribute “content-desc” but for iOS, the default Accessibility ID is set to the name of the UI element.

Is there any way I can set Accessibility ID as "content-desc" for iOS as well

React Native Version

0.71.8

Output of npx react-native info

OS: macOS 13.2
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Memory: 32.38 MB / 32.00 GB
Shell: 3.2.57 - /bin/bash

Binaries: Node: 14.21.3 - ~/.nvm/versions/node/v14.21.3/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 6.14.18 - ~/.nvm/versions/node/v14.21.3/bin/npm Watchman: 2023.05.08.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.12.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9514443 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 11.0.18 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: ^17.0.1 => 17.0.2 react-native: 0.71.8 => 0.71.8 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

I appium inspector on clicking on text field -

For Android, the value of Accessibility is the same as the value of the attribute “content-desc” but for iOS, the default Accessibility ID is set to the name of the UI element.

Expected- Android - Hello, enter your email iOS - Hello, enter your email

Result coming- Android - Hello, enter your email iOS - Email

Snack, code example, screenshot, or link to a repository

github-actions[bot] commented 1 year ago
:warning: Unsupported Version of React Native
:information_source: It looks like your issue or the example you provided uses an unsupported version of React Native. Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
chetnaag95 commented 1 year ago

I have upgraded the version still the same. TextInput sets element name to accessibility ID instead of accessibilityLabel of testID

github-actions[bot] commented 11 months ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 11 months ago

This issue was closed because it has been stalled for 7 days with no activity.

fabOnReact commented 9 months ago

Do you still experience this issue?

I have four years of experience maintaining facebook/react-native and I specialize in the Text and TextInput components. I currently have 58 facebook/react-native PRs.

If you still experience this issue, I will prepare a patched release with the fix.

Thanks a lot

ainarrasyid commented 1 month ago

is there any solution? im using appium-inpector to inspect accessiblityId, in android its same with testID props, but in IOS it show the textinput placeholder