From 3a184e394f6a878be0e0c3ebd61a3d6ace3465e8 Mon Sep 17 00:00:00 2001 From: Sven Lombaert Date: Fri, 4 Jul 2025 14:32:05 +0200 Subject: [PATCH] Optimize minDistance usage to only recognize current orientation --- src/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index e0bfa4a..870b07c 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -488,7 +488,11 @@ function InfinitePager( panGesture.enabled(!gesturesDisabled).withRef(gestureRef); if (typeof minDistance === "number") { - panGesture.minDistance(minDistance); + if (vertical) { + panGesture.activeOffsetY([-minDistance, minDistance]); + } else { + panGesture.activeOffsetX([-minDistance, minDistance]); + } } const externalGestures = useMemo(() => {