Skip to content

Commit

Permalink
fix modal closing when typing (#2408)
Browse files Browse the repository at this point in the history
* fix modal closing when typing

* fix linter issue

* lint

---------

Co-authored-by: Robinnnnn <rokim8@gmail.com>
  • Loading branch information
pvicensSpacedev and Robinnnnn authored Apr 6, 2024
1 parent 9760e68 commit 551d7d8
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { ANIMATION_CONFIGS, BottomSheetModal, BottomSheetModalProps } from '@gorhom/bottom-sheet';
import { NavigationContext, useNavigation } from '@react-navigation/native';
import { ForwardedRef, forwardRef, useEffect, useRef } from 'react';
import { Keyboard } from 'react-native';
import { Keyboard, Platform } from 'react-native';
import { ReduceMotion, SharedValue } from 'react-native-reanimated';

import { GalleryBottomSheetBackdrop } from '~/components/GalleryBottomSheet/GalleryBottomSheetBackdrop';
Expand Down Expand Up @@ -41,9 +41,14 @@ function GalleryBottomSheetModal(
[navigation]
);

const androidAnimationConfigs = {
...ANIMATION_CONFIGS,
reduceMotion: ReduceMotion.Never,
};

return (
<BottomSheetModal
animationConfigs={{ ...ANIMATION_CONFIGS, reduceMotion: ReduceMotion.Never }}
animationConfigs={Platform.OS === 'android' ? androidAnimationConfigs : undefined}
ref={(element) => {
bottomSheetRef.current = element;
if (typeof ref === 'function') {
Expand Down

0 comments on commit 551d7d8

Please sign in to comment.