Skip to content

Commit

Permalink
fix: removed onScroll event from BottomSheetScrollView (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom authored Jan 21, 2021
1 parent c32e700 commit 9039591
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
9 changes: 4 additions & 5 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,10 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
)}

{/* <BottomSheetDebugView
values={{
position,
manualSnapToPoint,
}}
/> */}
values={{
position,
}}
/> */}
</BottomSheetContainer>
</BottomSheetProvider>
);
Expand Down
6 changes: 3 additions & 3 deletions src/components/flatList/FlatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const BottomSheetFlatListComponent = forwardRef(
// hooks
const {
scrollableRef,
handleScrollEvent,
handleOnBeginDragEvent,
handleSettingScrollable,
} = useScrollableInternal('FlatList');
const {
Expand Down Expand Up @@ -73,8 +73,8 @@ const BottomSheetFlatListComponent = forwardRef(
overScrollMode="never"
bounces={false}
decelerationRate={decelerationRate}
scrollEventThrottle={1}
onScrollBeginDrag={handleScrollEvent}
scrollEventThrottle={16}
onScrollBeginDrag={handleOnBeginDragEvent}
/>
</NativeViewGestureHandler>
</BottomSheetDraggableView>
Expand Down
7 changes: 3 additions & 4 deletions src/components/scrollView/ScrollView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const BottomSheetScrollViewComponent = forwardRef(
// hooks
const {
scrollableRef,
handleScrollEvent,
handleOnBeginDragEvent,
handleSettingScrollable,
} = useScrollableInternal('ScrollView');
const {
Expand Down Expand Up @@ -71,9 +71,8 @@ const BottomSheetScrollViewComponent = forwardRef(
overScrollMode="never"
bounces={false}
decelerationRate={decelerationRate}
scrollEventThrottle={1}
onScroll={handleScrollEvent}
onScrollBeginDrag={handleScrollEvent}
scrollEventThrottle={16}
onScrollBeginDrag={handleOnBeginDragEvent}
/>
</NativeViewGestureHandler>
</BottomSheetDraggableView>
Expand Down
6 changes: 3 additions & 3 deletions src/components/sectionList/SectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const BottomSheetSectionListComponent = forwardRef(
// hooks
const {
scrollableRef,
handleScrollEvent,
handleOnBeginDragEvent,
handleSettingScrollable,
} = useScrollableInternal('SectionList');
const {
Expand Down Expand Up @@ -72,8 +72,8 @@ const BottomSheetSectionListComponent = forwardRef(
overScrollMode="never"
bounces={false}
decelerationRate={decelerationRate}
scrollEventThrottle={1}
onScrollBeginDrag={handleScrollEvent}
scrollEventThrottle={16}
onScrollBeginDrag={handleOnBeginDragEvent}
/>
</NativeViewGestureHandler>
</BottomSheetDraggableView>
Expand Down
4 changes: 2 additions & 2 deletions src/contexts/internal.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createContext, Ref, RefObject } from 'react';
import { TapGestureHandler, State } from 'react-native-gesture-handler';
import type { TapGestureHandler, State } from 'react-native-gesture-handler';
import type Animated from 'react-native-reanimated';
import { Scrollable, ScrollableRef } from '../types';
import type { Scrollable, ScrollableRef } from '../types';

export type BottomSheetInternalContextType = {
enableContentPanningGesture: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useScrollableInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const useScrollableInternal = (type: ScrollableType) => {
} = useBottomSheetInternal();

// callbacks
const handleScrollEvent = useMemo(
const handleOnBeginDragEvent = useMemo(
() =>
event([
{
Expand Down Expand Up @@ -65,7 +65,7 @@ export const useScrollableInternal = (type: ScrollableType) => {

return {
scrollableRef,
handleScrollEvent,
handleOnBeginDragEvent,
handleSettingScrollable,
};
};

0 comments on commit 9039591

Please sign in to comment.