Add accessible actions to adjust & close the bottom sheet #1788
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
DEFAULT_ACCESSIBLE
- When setting this totrue
, 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 tofalse
.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.accessibilityState
andaccessibilityValue
. I did not include this in the PR.Including users who have been part of previous accessibility initiatives to check my work: