Skip to content

Commit

Permalink
fix: hide the bottom sheet on closed (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Oct 12, 2021
1 parent 31b0151 commit 9f04d55
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1147,13 +1147,17 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
//#endregion

//#region styles
const containerAnimatedStyle = useAnimatedStyle(() => ({
transform: [
{
translateY: animatedPosition.value,
},
],
}));
const containerAnimatedStyle = useAnimatedStyle(
() => ({
opacity: animatedIndex.value === -1 ? 0 : 1,
transform: [
{
translateY: animatedPosition.value,
},
],
}),
[animatedPosition, animatedIndex]
);
const containerStyle = useMemo(
() => [_providedStyle, styles.container, containerAnimatedStyle],
[_providedStyle, containerAnimatedStyle]
Expand Down

0 comments on commit 9f04d55

Please sign in to comment.