Skip to content

Commit

Permalink
chore: reset currentGesture after transition finishes
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Aug 23, 2020
1 parent 9185a5f commit e7b6646
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,6 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
and(
eq(tapGestureState, State.FAILED),
eq(currentGesture, GESTURE.CONTENT),
eq(contentPanGestureState, State.END),
eq(handlePanGestureState, State.END),
neq(position, 0)
),
call([], () => {
Expand Down
3 changes: 2 additions & 1 deletion src/components/bottomSheet/useTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const useTransition = ({
snapPoints,
initialPosition,
}: TransitionProps) => {
const currentGesture = useValue<GESTURE>(0);
const currentGesture = useValue<GESTURE>(GESTURE.UNDETERMINED);
const currentPosition = useValue(initialPosition);

const isPanningContent = eq(contentPanGestureState, State.ACTIVE);
Expand Down Expand Up @@ -83,6 +83,7 @@ export const useTransition = ({

const finishTiming = useMemo(
() => [
set(currentGesture, GESTURE.UNDETERMINED),
set(shouldAnimate, 0),
set(currentPosition, config.toValue),
set(animationState.frameTime, 0),
Expand Down

0 comments on commit e7b6646

Please sign in to comment.