From 5302e20dd4edadfcaeb2133f5242b1ae06890c18 Mon Sep 17 00:00:00 2001 From: Mo Gorhom Date: Fri, 19 Mar 2021 22:24:06 +0000 Subject: [PATCH] fix: reset isclosing variable when position changed --- src/components/bottomSheet/BottomSheet.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/bottomSheet/BottomSheet.tsx b/src/components/bottomSheet/BottomSheet.tsx index 6734517..4bc4cf8 100644 --- a/src/components/bottomSheet/BottomSheet.tsx +++ b/src/components/bottomSheet/BottomSheet.tsx @@ -338,10 +338,6 @@ const BottomSheetComponent = forwardRef( if (_providedOnChange) { _providedOnChange(index); } - - if (isClosing.current && (index === 0 || index === -1)) { - isClosing.current = false; - } }); const handleSettingScrollableRef = useCallback( (scrollableRef: ScrollableRef) => { @@ -539,6 +535,11 @@ const BottomSheetComponent = forwardRef( call([currentPosition], args => { const currentPositionIndex = snapPoints.indexOf(args[0]); + /** + * reset is closing + */ + isClosing.current = false; + /** * if animation was interrupted, we ignore the change. */