-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Wrong translation from react-native's accessibilityLabel to iOS name/label #21830
Comments
It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists. The ":rewind:Old Version" label will be removed automatically once you edit your original post with the results of running |
I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while. If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here. |
This problem is still persisting on 0.57.7 as well so this should be reopened |
Is there a plan of fixing this behaviour in upcoming releases? Testing iOS applications using appium is hell atm |
This issue persists for me on 58.6 |
I came across this because one of my customer's apps was freezing the UI and crashing after spending ~10 seconds when trying to read the accessibilityLabel of a view with a "particularly complex and dynamic view hierarchy". I'm still not entirely sure what the app was doing, but I believe this will sidestep the issue entirely. I believe this change will also improve both the accessibility and the testability of RN apps, in addition to fixing that crash. This PR supersedes or fixes facebook#21830, facebook#25963, facebook#24113, facebook#24118, appium/appium#10654, possibly facebook#25220, and probably a few other tickets I haven't identified. Also worth mentioning that there is very similar code in https://github.com/facebook/react-native/blob/master/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L489-L515 - I haven't dug into that as much, but I suspect it should probably get the same treatment. If anyone wants, I can include it in this PR.
Environment
OS: macOS High Sierra 10.13.6
Node: 10.8.0
Yarn: Not Found
npm: 6.4.1
Watchman: Not Found
Xcode: Xcode 10.0 Build version 10A255
Android Studio: 3.1 AI-173.4907809
Packages: (wanted => installed)
react: ^16.4.1 => 16.4.1
react-native: ^0.55.4 => 0.55.4
Description
When accessibilityLabel set to the element in react-native code it translates to the iOS name/label, but all parent element's name/label accumulate accessibilityLabel value of a child element.
In Appium inspector it's looks like:
But in native code:
It completely ruins all efforts to automate testing of iOS app built from react-native code.
I investigated this issue and found it appears from work of RCTRecursiveAccessibilityLabel() function, which called in RCTView.m file in this code:
Change
return RCTRecursiveAccessibilityLabel(self);
toreturn nil;
- fix this issue, so I suggest this code changes to be implemented.The text was updated successfully, but these errors were encountered: