You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been like 1 year there is many issues reported on Android about onPress not fired (in issues of this repo and by a lot of end-user).
Since I cannot reproduce because a lot of this issue are "random", I was looking for an alternative with an onPressOut workaround.
Was able to implement a full working workaround on iOS (scroll management, hitslop, ...) but when switching to Android everything was broke. My solution was based on locationY and locationX but after investigation, I noticed that the value of locationY and locationX on Android is not correct.
For exemple, when the onPressOut is triggered because the touch goes out of the screen, the locationY is equal to pageY.
When the onPressOut is trigger after the touch leave the Pressable, but still on another Pressable (stacked Button for exemple). The locationY looks like it's the value inside the second Pressable (expected 80, but received 15 for exemple).
Description
To make a separate issue of:
#36710 (comment)
It's been like 1 year there is many issues reported on Android about onPress not fired (in issues of this repo and by a lot of end-user).
Since I cannot reproduce because a lot of this issue are "random", I was looking for an alternative with an
onPressOutworkaround.Was able to implement a full working workaround on iOS (scroll management, hitslop, ...) but when switching to Android everything was broke. My solution was based on
locationYandlocationXbut after investigation, I noticed that the value oflocationYandlocationXon Android is not correct.For exemple, when the
onPressOutis triggered because the touch goes out of the screen, thelocationYis equal topageY.When the
onPressOutis trigger after the touch leave the Pressable, but still on anotherPressable(stacked Button for exemple). ThelocationYlooks like it's the value inside the second Pressable (expected 80, but received 15 for exemple).Impact Touchables (WithoutFeedBack, Opacity, ...).
I don't know if it's the root-cause of all onPress issue, but might not help to handle it correctly.
In the code, found out that there is a "Legacy" / "non-legacy" logic that might explain why it's only on new-arch.
https://github.com/facebook/react-native/blob/d1a1020a4ab2f9bc5075598465b61fd83a45abd0/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.kt#L113
Regards
Steps to reproduce
onPressOut, log thelocationXandlocationYonPressOutof the first one is triggered but display invalid valuelocationX/Y(supposed to be the calculated values of the second Pressable).React Native Version
0.80.2
Affected Platforms
Runtime - Android
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://github.com/Dallas62/rn-pressabe-issue-location
Screenshots and Videos
Sans.titre.mov