-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Description
Hello,
I have some Pressable components inside another, and when I click on child one, it's triggered parent onPress action.
It occurs on real and simulator devices on Android and iOS.
Switch with Pressable component from react-native and the child onPress action doesn't trigger the parent onPress action.
I tried others pressable components like TouchableOpacity and here the results when I click on child pressable component:
TouchableHighlight in TouchableOpacity -> both trigered
TouchableOpacity in TouchableHighlight -> parent action trigered
TouchableOpacity in TouchableOpacity -> child action trigered
TouchableHighlight in TouchableHighlight -> child action trigered
Pressable in TouchableHighlight -> child action trigered
Pressable in TouchableOpacity -> both trigered
Pressable in Pressable -> both trigered
TouchableHighlight in Pressable -> both trigered
TouchableOpacity in Pressable -> parent action trigered
TextInput in Pressable -> parent action trigered (only on Android)
Steps to reproduce
- Clone repo
- react-native start
- Click on button on the first tab
- Check console logs
Snack or a link to a repository
https://github.com/TomCorvus/RNavigation
Gesture Handler version
2.21.2
React Native version
0.76.3
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
Expo bare workflow
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
Pixel 7 Pro, iPhone 16 Pro
Acknowledgements
Yes