diff --git a/src/components/AnimatedPagedView/index.tsx b/src/components/AnimatedPagedView/index.tsx index c4a9196..1d1c915 100644 --- a/src/components/AnimatedPagedView/index.tsx +++ b/src/components/AnimatedPagedView/index.tsx @@ -22,6 +22,9 @@ type AnimatedPagedViewProps = { children: React.ReactNode } +// easiest way to allow other gestures to work, for example the scroll view +const MIN_DISTANCE_THRESHOLD = 30 + export const AnimatedPagedView = forwardRef( (props, ref) => { const translateX = useSharedValue(0) @@ -38,6 +41,7 @@ export const AnimatedPagedView = forwardRef { context.value = { x: translateX.value } runOnJS(props.onScrollBeginDrag)() diff --git a/src/hooks/useManualScroll.ts b/src/hooks/useManualScroll.ts index 6da0f0d..450a91d 100644 --- a/src/hooks/useManualScroll.ts +++ b/src/hooks/useManualScroll.ts @@ -16,7 +16,7 @@ export const useManualScroll = ({ const goToPage = useCallback( (page: number, duration = 0, animation?: typeof DEFAULT_ANIMATION) => { 'worklet' - const to = page * slideWidth + const to = Math.round(page) * slideWidth if (duration) { manualScrollValue.value = { value: animation ? animation(to, duration) : withTiming(to, { duration }),