From ca0d8cd1cd65e6b62fdf0c32e68aa2e6226baad6 Mon Sep 17 00:00:00 2001 From: Mo Gorhom Date: Thu, 13 Aug 2020 09:14:58 +0200 Subject: [PATCH] fix: removed disableIntervalMomentum animated value (#13) --- src/components/bottomSheet/BottomSheet.tsx | 2 -- src/components/flatList/FlatList.tsx | 8 +------- src/components/scrollView/ScrollView.tsx | 8 +------- src/components/sectionList/SectionList.tsx | 8 +------- src/contexts/internal.ts | 1 - 5 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/components/bottomSheet/BottomSheet.tsx b/src/components/bottomSheet/BottomSheet.tsx index f6dc84e34..d1b3395c7 100644 --- a/src/components/bottomSheet/BottomSheet.tsx +++ b/src/components/bottomSheet/BottomSheet.tsx @@ -211,7 +211,6 @@ const BottomSheetComponent = forwardRef( /** * Scrollable animated props. */ - const disableIntervalMomentum = greaterThan(position, 0); const decelerationRate = cond(greaterThan(position, 0), 0.001, 0.999); //#endregion @@ -299,7 +298,6 @@ const BottomSheetComponent = forwardRef( contentPanGestureTranslationY, contentPanGestureVelocityY, scrollableContentOffsetY, - disableIntervalMomentum, decelerationRate, setScrollableRef: handleSettingScrollableRef, removeScrollableRef, diff --git a/src/components/flatList/FlatList.tsx b/src/components/flatList/FlatList.tsx index 91ed479c3..bdab357f0 100644 --- a/src/components/flatList/FlatList.tsx +++ b/src/components/flatList/FlatList.tsx @@ -43,11 +43,7 @@ const BottomSheetFlatListComponent = forwardRef( handleScrollEvent, handleSettingScrollable, } = useScrollableInternal('FlatList'); - const { - rootTapGestureRef, - disableIntervalMomentum, - decelerationRate, - } = useBottomSheetInternal(); + const { rootTapGestureRef, decelerationRate } = useBottomSheetInternal(); // effects // @ts-ignore @@ -70,8 +66,6 @@ const BottomSheetFlatListComponent = forwardRef( ref={scrollableRef} overScrollMode="never" bounces={false} - // @ts-ignore - disableIntervalMomentum={disableIntervalMomentum} decelerationRate={decelerationRate} scrollEventThrottle={1} onScrollBeginDrag={handleScrollEvent} diff --git a/src/components/scrollView/ScrollView.tsx b/src/components/scrollView/ScrollView.tsx index eb09caf97..e6382d10b 100644 --- a/src/components/scrollView/ScrollView.tsx +++ b/src/components/scrollView/ScrollView.tsx @@ -48,11 +48,7 @@ const BottomSheetScrollViewComponent = forwardRef( handleScrollEvent, handleSettingScrollable, } = useScrollableInternal('ScrollView'); - const { - rootTapGestureRef, - disableIntervalMomentum, - decelerationRate, - } = useBottomSheetInternal(); + const { rootTapGestureRef, decelerationRate } = useBottomSheetInternal(); // effects // @ts-ignore @@ -73,8 +69,6 @@ const BottomSheetScrollViewComponent = forwardRef( ref={scrollableRef} overScrollMode="never" bounces={false} - // @ts-ignore - disableIntervalMomentum={disableIntervalMomentum} decelerationRate={decelerationRate} scrollEventThrottle={1} onScrollBeginDrag={handleScrollEvent} diff --git a/src/components/sectionList/SectionList.tsx b/src/components/sectionList/SectionList.tsx index 38f740a27..a8dbf050f 100644 --- a/src/components/sectionList/SectionList.tsx +++ b/src/components/sectionList/SectionList.tsx @@ -43,11 +43,7 @@ const BottomSheetSectionListComponent = forwardRef( handleScrollEvent, handleSettingScrollable, } = useScrollableInternal('SectionList'); - const { - rootTapGestureRef, - disableIntervalMomentum, - decelerationRate, - } = useBottomSheetInternal(); + const { rootTapGestureRef, decelerationRate } = useBottomSheetInternal(); // effects // @ts-ignore useImperativeHandle(ref, () => scrollableRef.current!.getNode()); @@ -69,8 +65,6 @@ const BottomSheetSectionListComponent = forwardRef( ref={scrollableRef} overScrollMode="never" bounces={false} - // @ts-ignore - disableIntervalMomentum={disableIntervalMomentum} decelerationRate={decelerationRate} scrollEventThrottle={1} onScrollBeginDrag={handleScrollEvent} diff --git a/src/contexts/internal.ts b/src/contexts/internal.ts index 4bfd9213a..2194d3ae6 100644 --- a/src/contexts/internal.ts +++ b/src/contexts/internal.ts @@ -9,7 +9,6 @@ export type BottomSheetInternalContextType = { contentPanGestureTranslationY: Animated.Value; contentPanGestureVelocityY: Animated.Value; scrollableContentOffsetY: Animated.Value; - disableIntervalMomentum: Animated.Node; decelerationRate: Animated.Node; setScrollableRef: (ref: ScrollableRef) => void; removeScrollableRef: (ref: RefObject) => void;