From 885c8e87f3cf66d3c34768d959341a9288dd3ed8 Mon Sep 17 00:00:00 2001 From: Jimi Van Bylen <57633368+vbylen@users.noreply.github.com> Date: Sat, 13 Aug 2022 19:17:03 -0400 Subject: [PATCH] fix: enable pointerEvents during swiping solves issue #48 with proposed solution from @jmif here https://github.com/computerjazz/react-native-swipeable-item/issues/48#issuecomment-1185848720 --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index aa17ee3..4475f63 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -261,7 +261,6 @@ function SwipeableItem( }); function onAnimationEnd(openDirection: OpenDirection, snapPoint: number) { - setOpenDirection(openDirection); onChange({ open: openDirection, snapPoint }); } @@ -311,6 +310,7 @@ function SwipeableItem( : closestSnapPoint > 0 ? OpenDirection.RIGHT : OpenDirection.LEFT; + runOnJS(setOpenDirection)(openDirection) runOnJS(onAnimationEnd)(openDirection, Math.abs(closestSnapPoint)); }; if (animStatePos.value === closestSnapPoint) onComplete();