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

accessible = {false} not working in Android #22086

Closed
bmbmjmdm opened this issue Nov 2, 2018 · 7 comments
Closed

accessible = {false} not working in Android #22086

bmbmjmdm opened this issue Nov 2, 2018 · 7 comments
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@bmbmjmdm
Copy link

bmbmjmdm commented Nov 2, 2018

Environment

OS: Windows 10
Node: 8.11.3
Yarn: Not Found
npm: 6.4.1
Watchman: 4.9.4
Xcode: N/A
Android Studio: Version 1.4.0.0 AI-141.2343393
Packages: (wanted => installed)
react: 16.5.0 => 16.5.0
react-native: ~0.57.2 => 0.57.2

Description

Setting the property "accessible" to {false} on a UI element doesn't appear to do anything.

Reproducible Demo

Create a parent text element and add 2 child text elements within it. Set the child text elements to accessible={true} and the parent to accessible={false}. Run on android with voice assistance. Notice the parent text element will receive focus and not the children, which is not expected behavior when the parent has accessible={false}

@react-native-bot
Copy link
Collaborator

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 "⏪Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@bmbmjmdm
Copy link
Author

bmbmjmdm commented Nov 2, 2018

Ran a fresh react native project using v0.57.2, reproduced the problem

@bartolkaruza
Copy link

fresh project on 0.57.4?

@bmbmjmdm
Copy link
Author

bmbmjmdm commented Nov 3, 2018

Just tried, same result

@bartolkaruza
Copy link

If I understand the <Text /> component on Android correctly, it actually turns nested text into a single TextView. Because there is only one actual TextView from your three Text components, there is only one accessible element (the parent). Try wrapping the child Text components in a parent View component, which should translate into three actual views on the native side. Wrapping will work differently in that case though.

@palexs
Copy link

palexs commented Feb 6, 2019

In my case using importantForAccessibility={'no'} helped opt-out a Text component from accessibility reach.

@elicwhite
Copy link
Member

@bartolkaruza's comment seems like it explains the issue and that this is working as expected.

@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants