From b2476d1b7912e30ef3aa187440595b8bf3ca2640 Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Tue, 28 Apr 2026 10:02:38 +0200 Subject: [PATCH 1/2] Change callback order Co-authored-by: Copilot --- .../src/v3/components/Touchable/Touchable.tsx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/react-native-gesture-handler/src/v3/components/Touchable/Touchable.tsx b/packages/react-native-gesture-handler/src/v3/components/Touchable/Touchable.tsx index 78b85aa37c..c182a730e2 100644 --- a/packages/react-native-gesture-handler/src/v3/components/Touchable/Touchable.tsx +++ b/packages/react-native-gesture-handler/src/v3/components/Touchable/Touchable.tsx @@ -89,19 +89,14 @@ export const Touchable = (props: TouchableProps) => { } }, []); - const onDeactivate = useCallback( - (e: EndCallbackEventType) => { - if (!e.canceled && !longPressDetected.current && e.pointerInside) { - onPress?.(e); - } - }, - [onPress] - ); - const onFinalize = useCallback( (e: EndCallbackEventType) => { if (pointerState.current === PointerState.INSIDE) { onPressOut?.(e); + + if (!e.canceled && !longPressDetected.current) { + onPress?.(e); + } } pointerState.current = PointerState.UNKNOWN; @@ -157,7 +152,6 @@ export const Touchable = (props: TouchableProps) => { enabled={!disabled} onBegin={onBegin} onActivate={onActivate} - onDeactivate={onDeactivate} onFinalize={onFinalize} onUpdate={onUpdate} defaultOpacity={defaultOpacity} From 49a0ba558a4133cd26f604f2328d515af535c27a Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Tue, 28 Apr 2026 10:08:49 +0200 Subject: [PATCH 2/2] Review changes --- .../src/v3/components/Touchable/Touchable.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-native-gesture-handler/src/v3/components/Touchable/Touchable.tsx b/packages/react-native-gesture-handler/src/v3/components/Touchable/Touchable.tsx index c182a730e2..6651ef0f78 100644 --- a/packages/react-native-gesture-handler/src/v3/components/Touchable/Touchable.tsx +++ b/packages/react-native-gesture-handler/src/v3/components/Touchable/Touchable.tsx @@ -93,10 +93,10 @@ export const Touchable = (props: TouchableProps) => { (e: EndCallbackEventType) => { if (pointerState.current === PointerState.INSIDE) { onPressOut?.(e); + } - if (!e.canceled && !longPressDetected.current) { - onPress?.(e); - } + if (!e.canceled && !longPressDetected.current && e.pointerInside) { + onPress?.(e); } pointerState.current = PointerState.UNKNOWN; @@ -106,7 +106,7 @@ export const Touchable = (props: TouchableProps) => { longPressTimeout.current = undefined; } }, - [onPressOut] + [onPressOut, onPress] ); const onUpdate = useCallback(