-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Missing infoPlatform: AndroidThis issue is specific to AndroidThis issue is specific to AndroidRepro providedA reproduction with a snack or repo is providedA reproduction with a snack or repo is provided
Description
Description
I noticed that the onTouchesDown and onTouchesUp callback is being fired ona all currently touched gesture detectors when I start/stop touching just one of them but keep touching the other one.
The example, on which I tested it it works, is very simple and consists of just 2 boxes with gesture detectors:
Example source code
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
type BoxProps = {
label: string;
};
function Box({ label }: BoxProps) {
const manual = Gesture.Manual()
.onTouchesDown(() => {
console.log('down', label);
})
.onTouchesUp(() => {
console.log('up', label);
})
.onTouchesCancelled(() => {
console.log('cancelled', label);
});
return (
<GestureDetector gesture={manual}>
<View style={styles.box}>
<Text style={styles.text}>{label}</Text>
</View>
</GestureDetector>
);
}
export default function EmptyExample() {
return (
<View style={styles.container}>
<Box label="1" />
<Box label="2" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
gap: 10,
},
box: {
width: 100,
height: 100,
backgroundColor: 'red',
alignItems: 'center',
justifyContent: 'center',
},
text: {
color: 'white',
fontSize: 20,
fontWeight: 'bold',
},
});Android
Screen.Recording.2025-06-04.at.11.03.05.mp4
iOS
Screen.Recording.2025-06-04.at.11.05.12.mp4
Steps to reproduce
- I pressed the first box (with number 1) and didn't release the finger
- I was tapping on the second box (with number 2) - started and stopped pressing for a few times
- I finally released the finger from the first box (number 1)
A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.
https://snack.expo.dev/JaZCc4_vZlmyDOFHRlMEs
Gesture Handler version
2.25.0 (and older)
React Native version
0.80.0-rc.4 (and older)
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Missing infoPlatform: AndroidThis issue is specific to AndroidThis issue is specific to AndroidRepro providedA reproduction with a snack or repo is providedA reproduction with a snack or repo is provided
