Skip to content

Commit

Permalink
fix: reset isclosing variable when position changed
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Mar 19, 2021
1 parent 3abe599 commit 5302e20
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,6 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
if (_providedOnChange) {
_providedOnChange(index);
}

if (isClosing.current && (index === 0 || index === -1)) {
isClosing.current = false;
}
});
const handleSettingScrollableRef = useCallback(
(scrollableRef: ScrollableRef) => {
Expand Down Expand Up @@ -539,6 +535,11 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
call([currentPosition], args => {
const currentPositionIndex = snapPoints.indexOf(args[0]);

/**
* reset is closing
*/
isClosing.current = false;

/**
* if animation was interrupted, we ignore the change.
*/
Expand Down

0 comments on commit 5302e20

Please sign in to comment.