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

Fix: allow screen readers to detect modal content #1764

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions example/bare/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import org.apache.tools.ant.taskdefs.condition.Os

buildscript {
ext {
buildToolsVersion = "31.0.0"
buildToolsVersion = "32.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
compileSdkVersion = 32
targetSdkVersion = 32

if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
Expand Down Expand Up @@ -48,6 +48,11 @@ allprojects {
}
}
google()
jcenter() {
content {
includeModule("com.eightbitlab", "blurview")
}
}
maven { url 'https://www.jitpack.io' }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ const BottomSheetBackgroundComponent = ({
pointerEvents,
style,
}: BottomSheetBackgroundProps) => (
<View
pointerEvents={pointerEvents}
accessible={true}
accessibilityRole="adjustable"
accessibilityLabel="Bottom Sheet"
style={[styles.container, style]}
/>
<View pointerEvents={pointerEvents} style={[styles.container, style]} />
);

const BottomSheetBackground = memo(BottomSheetBackgroundComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const BottomSheetBackgroundContainerComponent = ({

return _providedBackgroundComponent === null ? null : (
<BackgroundComponent
pointerEvents="none"
pointerEvents="box-none"
animatedIndex={animatedIndex}
animatedPosition={animatedPosition}
style={backgroundStyle}
Expand Down
5 changes: 5 additions & 0 deletions src/components/bottomSheetModal/BottomSheetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const BottomSheetModalComponent = forwardRef<

// components
children: Content,

// Override default accessibility prop to ensure their content can be read by Voice Over (iOS screen reader)
accessible = null,

...bottomSheetProps
} = props;

Expand Down Expand Up @@ -379,6 +383,7 @@ const BottomSheetModalComponent = forwardRef<
<ContainerComponent key={key}>
<BottomSheet
{...bottomSheetProps}
accessible={accessible}
ref={bottomSheetRef}
key={key}
index={index}
Expand Down