-
-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onPress action on Pressable component inside another triggers both actions #3282
Comments
I can add |
I tried your fix, but it seems to not fix the |
Previous PR fixed different issue. Could you check if #3295 solves this one for you? |
Great @coado, it seems to fix the problem. Do you know when a new version including all theses fixes will be released? |
The stable version will be released around 10th January 2025 probably. The PR is not fully ready to be merged though as it still doesn't work on the old arch :/ |
unfortunately, This patch is not enough on my side (with new arch)... |
Hey @freeboub, could you share the code that doesn't work for you? Also, have you tested on this PR specifically? |
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 fromreact-native
and the childonPress
action doesn't trigger the parentonPress
action.I tried others pressable components like
TouchableOpacity
and here the results when I click on child pressable component:TouchableHighlight
inTouchableOpacity
-> both trigeredTouchableOpacity
inTouchableHighlight
-> parent action trigeredTouchableOpacity
inTouchableOpacity
-> child action trigeredTouchableHighlight
inTouchableHighlight
-> child action trigeredPressable
inTouchableHighlight
-> child action trigeredPressable
inTouchableOpacity
-> both trigeredPressable
inPressable
-> both trigeredTouchableHighlight
inPressable
-> both trigeredTouchableOpacity
inPressable
-> parent action trigeredTextInput
inPressable
-> parent action trigered (only on Android)Steps to reproduce
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
The text was updated successfully, but these errors were encountered: