Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: removed onScroll event from BottomSheetScrollView #225

Merged
merged 1 commit into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
};
};