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

Mobile: Accessibility: Improve setting control accessibility #11358

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Nov 8, 2024

Summary

This pull request should improve the accessibility of controls in the mobile settings screen. In particular, it:

  1. Associates labels with text inputs using aria-labelledby.
    • It doesn't seem possible to do this with sliders/switches in React Native.
  2. Adds labels to dropdowns and switches using accessibilityHint.
  3. Replaces settings-related usage of role= with accessibilityRole=. On Android, the role prop seems to have no effect (where the accessibilityRole prop does).
  4. For screen readers: Marks the selected item in dropdowns as selected.

Testing

Manual testing plan

Android:

  1. Open settings.
  2. Enable TalkBack.
  3. Open the "general" tab.
  4. Focus the "date format" dropdown.
  5. Verify that TalkBack marks the dropdown as a "button" and reads the label associated with the dropdown.
    • Previously, the dropdown was not labelled with a role.
  6. Open the dropdown.
  7. Verify that the selected item has accessibility focus.
  8. Swipe to the next item.
  9. Swipe to the previous item.
  10. Verify that TalkBack reads the last-selected item as "selected".
  11. Close the dropdown by selecting an item.
  12. Move accessibility focus to the "automatically delete notes in the trash after a number of days" switch.
  13. Verify that TalkBack reads the switch label when the switch is focused.
  • Previously, the label was not programatically associated with the switch. With this pull request, the label is associated using accessibilityHint — associating the label with aria-labelledby doesn't seem to work.
  1. Switch to the "Note" tab
  2. Focus the "Voice Typing language files" textbox.
  3. Verify that TalkBack reads "Edit box for Voice Typing language files (URL)"

For now, the button that opens dropdowns uses the "button" accessibility role
this does not properly describe what clicking the button will do to screen
reader users.
@laurent22 laurent22 merged commit 4d5b1ce into laurent22:dev Nov 9, 2024
7 checks passed
@personalizedrefrigerator
Copy link
Collaborator Author

I'm linking this to #10795.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Related to accessibility android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants