Skip to content

Commit

Permalink
fix: removed disableIntervalMomentum animated value (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Aug 13, 2020
1 parent 787cf8a commit ca0d8cd
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 24 deletions.
2 changes: 0 additions & 2 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
/**
* Scrollable animated props.
*/
const disableIntervalMomentum = greaterThan(position, 0);
const decelerationRate = cond(greaterThan(position, 0), 0.001, 0.999);
//#endregion

Expand Down Expand Up @@ -299,7 +298,6 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
contentPanGestureTranslationY,
contentPanGestureVelocityY,
scrollableContentOffsetY,
disableIntervalMomentum,
decelerationRate,
setScrollableRef: handleSettingScrollableRef,
removeScrollableRef,
Expand Down
8 changes: 1 addition & 7 deletions src/components/flatList/FlatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ const BottomSheetFlatListComponent = forwardRef(
handleScrollEvent,
handleSettingScrollable,
} = useScrollableInternal('FlatList');
const {
rootTapGestureRef,
disableIntervalMomentum,
decelerationRate,
} = useBottomSheetInternal();
const { rootTapGestureRef, decelerationRate } = useBottomSheetInternal();

// effects
// @ts-ignore
Expand All @@ -70,8 +66,6 @@ const BottomSheetFlatListComponent = forwardRef(
ref={scrollableRef}
overScrollMode="never"
bounces={false}
// @ts-ignore
disableIntervalMomentum={disableIntervalMomentum}
decelerationRate={decelerationRate}
scrollEventThrottle={1}
onScrollBeginDrag={handleScrollEvent}
Expand Down
8 changes: 1 addition & 7 deletions src/components/scrollView/ScrollView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ const BottomSheetScrollViewComponent = forwardRef(
handleScrollEvent,
handleSettingScrollable,
} = useScrollableInternal('ScrollView');
const {
rootTapGestureRef,
disableIntervalMomentum,
decelerationRate,
} = useBottomSheetInternal();
const { rootTapGestureRef, decelerationRate } = useBottomSheetInternal();

// effects
// @ts-ignore
Expand All @@ -73,8 +69,6 @@ const BottomSheetScrollViewComponent = forwardRef(
ref={scrollableRef}
overScrollMode="never"
bounces={false}
// @ts-ignore
disableIntervalMomentum={disableIntervalMomentum}
decelerationRate={decelerationRate}
scrollEventThrottle={1}
onScrollBeginDrag={handleScrollEvent}
Expand Down
8 changes: 1 addition & 7 deletions src/components/sectionList/SectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -69,8 +65,6 @@ const BottomSheetSectionListComponent = forwardRef(
ref={scrollableRef}
overScrollMode="never"
bounces={false}
// @ts-ignore
disableIntervalMomentum={disableIntervalMomentum}
decelerationRate={decelerationRate}
scrollEventThrottle={1}
onScrollBeginDrag={handleScrollEvent}
Expand Down
1 change: 0 additions & 1 deletion src/contexts/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export type BottomSheetInternalContextType = {
contentPanGestureTranslationY: Animated.Value<number>;
contentPanGestureVelocityY: Animated.Value<number>;
scrollableContentOffsetY: Animated.Value<number>;
disableIntervalMomentum: Animated.Node<number>;
decelerationRate: Animated.Node<number>;
setScrollableRef: (ref: ScrollableRef) => void;
removeScrollableRef: (ref: RefObject<Scrollable>) => void;
Expand Down

0 comments on commit ca0d8cd

Please sign in to comment.