Skip to content

Commit

Permalink
fix: update handleSnapTo on modal to use index parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Mar 17, 2021
1 parent d86c1fa commit 789b8da
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/bottomSheetModal/BottomSheetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,16 @@ const BottomSheetModalComponent = forwardRef<
//#endregion

//#region bottom sheet methods
const handleSnapTo = useCallback(() => {
if (minimized.current) {
return;
}
const handleSnapTo = useCallback(
(_index: number) => {
if (minimized.current) {
return;
}

bottomSheetRef.current?.snapTo(adjustIndex(currentIndexRef.current));
}, [adjustIndex]);
bottomSheetRef.current?.snapTo(adjustIndex(_index));
},
[adjustIndex]
);
const handleExpand = useCallback(() => {
if (minimized.current) {
return;
Expand Down

0 comments on commit 789b8da

Please sign in to comment.