Skip to content

Commit ab1cce2

Browse files
committed
fix: bottom sheet not appearing for users that have reduced motion turned on (#1743)(by @fobos531)
1 parent 9034ae8 commit ab1cce2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/utilities/animate.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import {
44
withTiming,
55
withSpring,
66
AnimationCallback,
7+
// @ts-ignore
8+
ReduceMotion,
79
} from 'react-native-reanimated';
810
import { ANIMATION_CONFIGS, ANIMATION_METHOD } from '../constants';
911

@@ -26,6 +28,14 @@ export const animate = ({
2628
configs = ANIMATION_CONFIGS;
2729
}
2830

31+
// Users might have an accessibililty setting to reduce motion turned on.
32+
// This prevents the animation from running when presenting the sheet, which results in
33+
// the bottom sheet not even appearing so we need to override it to ensure the animation runs.
34+
if (ReduceMotion) {
35+
// @ts-ignore
36+
configs.reduceMotion = ReduceMotion.Never;
37+
}
38+
2939
// detect animation type
3040
const type =
3141
'duration' in configs || 'easing' in configs

0 commit comments

Comments
 (0)