From 789b8dacd2855569bc6d12f887e086a27e2860b5 Mon Sep 17 00:00:00 2001 From: Mo Gorhom Date: Wed, 17 Mar 2021 23:52:21 +0000 Subject: [PATCH] fix: update handleSnapTo on modal to use index parameter --- .../bottomSheetModal/BottomSheetModal.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/bottomSheetModal/BottomSheetModal.tsx b/src/components/bottomSheetModal/BottomSheetModal.tsx index a82a7a89b..8449fd9b5 100644 --- a/src/components/bottomSheetModal/BottomSheetModal.tsx +++ b/src/components/bottomSheetModal/BottomSheetModal.tsx @@ -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;