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

accessibilityLabel does not work for Text component on iOS #14123

Closed
curioustechizen opened this issue May 23, 2017 · 16 comments
Closed

accessibilityLabel does not work for Text component on iOS #14123

curioustechizen opened this issue May 23, 2017 · 16 comments
Assignees
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@curioustechizen
Copy link

Description

Continuing the discussion from #13648 (comment), for <Text> component on iOS, the actual label of the text always overrides the testID and accessibilityLabel

Reproduction Steps and Sample Code

  1. Create a new RN app using react-native init
  2. Edit index.ios.js
  3. Find the "Welcome to React Native" text and change it to
<Text testID={'welcome'} accessibilityLabel={'welcome'}>Welcome to React Native!</Text>
  1. Run this app on an iOS simulator and inspect it with Accessibility Inspector

Expected: The Accessibility Inspector should say the Label is welcome.
Actual: The Accessibility Inspector says the Label is Welcome to React Native!.

Note: - with the same set of properties on Android the contentDescription is welcome which is what I expect.

Additional Information

  • React Native version: 0.44.0
  • Platform: iOS 10.1 Simulator
  • Development Operating System: Mac OSX 10.11.6
  • Dev tools: XCode 8.1, Accessibility Inspector 5.0
@shergin
Copy link
Contributor

shergin commented May 23, 2017

Thank you, @curioustechizen! I will fix that.

@hramos hramos added the Icebox label Jul 25, 2017
@hramos
Copy link
Contributor

hramos commented Jul 25, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos closed this as completed Jul 25, 2017
@shergin
Copy link
Contributor

shergin commented Jul 28, 2017

@curioustechizen Could you please verify that it is already fixed? (It should be.)

@curioustechizen
Copy link
Author

@shergin Does not seem to be fixed. With

  • React Native version: 0.46.4
  • Platform: iOS 10.3 Simulator
  • Development Operating System: Mac OSX 10.12.5
  • Dev tools: XCode 8.3.2, Accessibility Inspector 5.0

I still see
Actual: The Accessibility Inspector says the Label is Welcome to React Native!.

Is there a way to programmatically display current RN version on screen - just to make sure I'm not messing something up?

@benadamstyles
Copy link

@curioustechizen You can use https://github.com/rebeccahughes/react-native-device-info#example to get the current version.

@curioustechizen
Copy link
Author

@Leeds-eBooks I don't want to display the app version - I want to find out the version of ReactNative that's being used in the app. I couldn't find a way to do that with the linked library.

@benadamstyles
Copy link

Ah stupid me, sorry! A hacky way would be to require the RN package.json.

@shergin shergin reopened this Jul 29, 2017
@vasyares
Copy link

vasyares commented Sep 5, 2017

Hello. Any updates regarding this issue?

@shergin
Copy link
Contributor

shergin commented Sep 5, 2017

Sorry, not yet. 😞 (t21623750)

@vasyares
Copy link

vasyares commented Sep 6, 2017

@shergin thank you for the quick response.
We are using accessibilityLabel for UI testing on our project. Could you please tell us when this issue might be fixed?
Thank you.

@shergin
Copy link
Contributor

shergin commented Sep 7, 2017

We are currently working at it. I will keep posting updates here.

@vasyares
Copy link

vasyares commented Sep 7, 2017

Thank you.
BTW we started using testId attribute. Seems it works. We are able to see correct identifiers with Debug View Hierarchy after attaching to process with Xcode debugger.

@vasyares
Copy link

Hello @shergin,
Looks like issue for text element is still there. Using of testId does not fix it.

@shergin
Copy link
Contributor

shergin commented Sep 12, 2017

cc @lostatseajoshua

@lostatseajoshua
Copy link

@curioustechizen @vasyares The fix has been made and is in a PR. Setting the accessibilityLabel of a <Text> component will now return the correct value as expected.

@hramos
Copy link
Contributor

hramos commented Sep 12, 2017

This has been fixed as of 915a020

@hramos hramos closed this as completed Sep 12, 2017
fearmear added a commit to fearmear/react-native that referenced this issue May 30, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Sep 12, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants