Skip to content

Commit ac02b27

Browse files
committed
Reset longpress outside of if
1 parent d6113c6 commit ac02b27

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • packages/react-native-gesture-handler/src/v3/components/Clickable

packages/react-native-gesture-handler/src/v3/components/Clickable/Clickable.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ export const Clickable = (props: ClickableProps) => {
4747
}, [onLongPress]);
4848

4949
const startLongPressTimer = useCallback(() => {
50+
longPressDetected.current = false;
51+
5052
if (onLongPress && !longPressTimeout.current) {
51-
longPressDetected.current = false;
5253
longPressTimeout.current = setTimeout(wrappedLongPress, delayLongPress);
5354
}
5455
}, [onLongPress, delayLongPress, wrappedLongPress]);

0 commit comments

Comments
 (0)