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

Add accessible actions to adjust & close the bottom sheet #1788

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jgillick
Copy link

@jgillick jgillick commented Apr 8, 2024

Connect the accessible labels to bottom sheet actions/behaviors.

Motivation

The current accessibility attributes only talk at the user, but don't let a user using a screen reader (like iOS VoiceOver) to actually adjust or close the bottom sheet. These actions need to be wired up explicitly (more info)

Notes

  • The text "Drag up or down to extend or minimize the bottom sheet" is redundant because the screen reader will explain that to them.
  • DEFAULT_ACCESSIBLE - When setting this to true, the screen reader will not let the user navigate the contents of the sheet. The user will just get the label read to them. This should default to false.
  • onAccessibilityEscape & 'escape' action - These are global handlers that lets the user close the sheet with a "scrub" gensture (two fingers making a Z on the screen)
  • activate action - This lets the user double-tap on the handle to close the bottom sheet (similar to iOS maps)

Other considerations

  • BottomSheetModal does not function like an actual modal. When it opens the focus is not brought to the modal and the user can still navigate outside of the modal. I don't know if this is expected behavior.
  • The default role is "adjustable", so technically, the handle should notify the user what the state of the bottom sheet via accessibilityState and accessibilityValue. I did not include this in the PR.
  • The screen reader focus should select the bottom sheet when it opens and then focus should go back to the previously element when it closes. Using React Native's Modal element will do this automatically.

Including users who have been part of previous accessibility initiatives to check my work:

Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

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

Successfully merging this pull request may close these issues.

None yet

1 participant