Skip to content

Commit

Permalink
fix: remove logic that touch the screent will stopped animation
Browse files Browse the repository at this point in the history
  • Loading branch information
dohooo committed Mar 3, 2022
1 parent 324ce5f commit 4328d9a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ScrollViewGesture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type { WithTimingAnimation } from './types';
import { dealWithAnimation } from './utils/dealWithAnimation';

type GestureContext = {
validStart: boolean;
panOffset: number;
max: number;
};
Expand Down Expand Up @@ -210,12 +211,16 @@ const IScrollViewGesture: React.FC<Props> = (props) => {
{
onStart: (_, ctx) => {
touching.value = true;
cancelAnimation(translation);
ctx.validStart = true;
onScrollBegin && runOnJS(onScrollBegin)();
ctx.max = (maxPage - 1) * size;
ctx.panOffset = translation.value;
},
onActive: (e, ctx) => {
if (ctx.validStart) {
ctx.validStart = false;
cancelAnimation(translation);
}
touching.value = true;
const { translationX, translationY } = e;
let panTranslation = isHorizontal.value
Expand Down

0 comments on commit 4328d9a

Please sign in to comment.