Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/backdrops-voiceover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@gryt/ui-native": patch
---

Dialog and Drawer no longer hide their contents from VoiceOver. A VoiceOver user can also close them with the escape gesture now.
3 changes: 3 additions & 0 deletions packages/ui-native/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function Popup({
// iOS hides everything behind a modal from VoiceOver with this; Android
// gets the same effect from Modal itself.
accessibilityViewIsModal
onAccessibilityEscape={dismissible ? () => setOpen(false) : undefined}
style={[
{
width: "100%",
Expand Down Expand Up @@ -129,7 +130,9 @@ function Popup({
// AlertDialog turns it off for the same reason it turns off the scrim.
onRequestClose={dismissible ? () => setOpen(false) : undefined}
>
{/* Not `accessible`: a Pressable is by default, and that hides everything inside it from VoiceOver. */}
<Pressable
accessible={false}
// The scrim doubles as the outside-press target, which is how Base UI
// dismisses too.
onPress={dismissible ? () => setOpen(false) : undefined}
Expand Down
4 changes: 4 additions & 0 deletions packages/ui-native/src/components/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ function Popup({
animationType="none"
onRequestClose={dismissible ? () => setOpen(false) : undefined}
>
{/* Not `accessible`: a Pressable is by default, and that hides everything inside it from VoiceOver. */}
<Pressable
accessible={false}
onPress={dismissible ? () => setOpen(false) : undefined}
style={{ flex: 1 }}
>
Expand All @@ -340,6 +342,7 @@ function Popup({
<GestureDetector gesture={pan}>
<Animated.View
accessibilityViewIsModal
onAccessibilityEscape={dismissible ? () => setOpen(false) : undefined}
style={[
{
position: "absolute",
Expand Down Expand Up @@ -368,6 +371,7 @@ function Popup({
]}
>
<Pressable
accessible={false}
onPress={() => {}}
style={[
{
Expand Down
Loading