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

Accessibility state treated incorrectly on iOS #45300

Open
biadars opened this issue Jul 5, 2024 · 2 comments
Open

Accessibility state treated incorrectly on iOS #45300

biadars opened this issue Jul 5, 2024 · 2 comments
Assignees
Labels
Accessibility Help Wanted :octocat: Issues ideal for external contributors. Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications.

Comments

@biadars
Copy link

biadars commented Jul 5, 2024

Description

I'm seeing two strange behaviours around the disabled property and accessibilitState.disabled on iOS:

  • Setting disabled={true} on a TouchableOpacity leads to Voiceover reading the label of the touchable opacity followed by "link"
    • Even if you set role="button" and accessibilityRole="button", VoiceOver will still read out " link button"
    • In the example I've included you can see once you bump the counter up and the minus button is no longer disabled, it stops getting read out as a link
  • Whatever is set for accessibilityState.disabled is never read out. Other properties, like accessibilityState.selected are still read out

Both of these issues happen on iOS (I'm including a snack, my iOS version is 17.5.1 - I've not tested this on other iOS versions), but TalkBack correctly reads out the button role and accessibilityState.

Steps to reproduce

  1. Create a and assign it a button role and accessibilityRole
  2. Set disabled={true} on it and accessibilityState={{disabled: true}}
  3. Turn on VoiceOver and focus on the TouchableOpacity

Expected behaviour

  • The TouchableOpacity's is read out as " button disabled"

Actual behaviour

  • The TouchableOpacity is read out as " link button"
    • "disabled" is never read out
    • Removing disabled={true} leads to the component no longer being read out as a link

React Native Version

0.74.0

Affected Platforms

Runtime - iOS

Output of npx react-native info

Not applicable as developing directly in Expo Snack

Stacktrace or Logs

Not applicable as developing directly in Expo Snack

Reproducer

https://snack.expo.dev/_f-0w64MnvIqQ65myDxPW

Screenshots and Videos

No response

Copy link

github-actions bot commented Jul 5, 2024

⚠️ Add or Reformat Version Info
ℹ️ We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2

@cortinico cortinico added Help Wanted :octocat: Issues ideal for external contributors. Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Accessibility and removed Needs: Author Feedback Needs: Version Info labels Jul 5, 2024
@biadars
Copy link
Author

biadars commented Jul 12, 2024

FYI this also occurs on iOS 16 - I've now tested it on iOS 16.7.8

@blakef blakef self-assigned this Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Help Wanted :octocat: Issues ideal for external contributors. Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications.
Projects
None yet
Development

No branches or pull requests

3 participants