Skip to content

Commit

Permalink
fix: prevent sheet from stucking on close state
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Mar 29, 2021
1 parent 0fd2b9d commit 63a1891
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,10 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
animationDuration: number = DEFAULT_ANIMATION_DURATION,
animationEasing: Animated.EasingFunction = DEFAULT_ANIMATION_EASING
) => {
if (isClosing.current) {
if (
isClosing.current ||
animatedPosition.value === safeContainerHeight
) {
return;
}
isClosing.current = true;
Expand All @@ -534,7 +537,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
easing: animationEasing,
});
},
[animateToPoint, safeContainerHeight]
[animateToPoint, safeContainerHeight, animatedPosition]
);
const handleExpand = useCallback(
(
Expand Down

0 comments on commit 63a1891

Please sign in to comment.