Skip to content
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

Long press broken for TouchableNativeFeedback #24001

Closed
mjmasn opened this issue Mar 18, 2019 · 24 comments
Closed

Long press broken for TouchableNativeFeedback #24001

mjmasn opened this issue Mar 18, 2019 · 24 comments
Labels
Bug Component: TouchableNativeFeedback Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.

Comments

@mjmasn
Copy link
Contributor

mjmasn commented Mar 18, 2019

🐛 Bug Report

After upgrading from React Native 0.58.6 to 0.59.1, any <TouchableNativeFeedback /> with onLongPress is no longer working i.e. the handler is never fired.

To Reproduce

Use TouchableNativeFeedback with onLongPress in a React Native 0.59.1 app.

Expected Behavior

Long pressing the TouchableNativeFeedback triggers the onLongPress handler

Code Example

https://github.com/mjmasn/rn59_tnf_longpress

Environment

info 
  React Native Environment Info:
    System:
      OS: Linux 4.15 Ubuntu 16.04.6 LTS (Xenial Xerus)
      CPU: (8) x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
      Memory: 856.03 MB / 15.54 GB
      Shell: 4.3.48 - /bin/bash
    Binaries:
      Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
      Yarn: 1.15.2 - /usr/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      Android SDK:
        API Levels: 16, 19, 22, 23, 26, 27, 28
        Build Tools: 23.0.1, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.3, 28.0.2, 28.0.3
        System Images: android-16 | Google APIs Intel x86 Atom, android-17 | Google APIs Intel x86 Atom, android-18 | Google APIs Intel x86 Atom, android-19 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-24 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64
    IDEs:
      Android Studio: 3.1 AI-173.4907809
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.1 => 0.59.1 
    npmGlobalPackages:
      create-react-native-app: 2.0.2
      react-native-cli: 2.0.1
      react-native-create-library: 3.1.2
      react-native-git-upgrade: 0.2.7
@kelset kelset added the Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. label Mar 18, 2019
@rickhanlonii
Copy link
Member

Hey @mjmasn thanks for filing, I looked into this and the long press appears to be working in your repo:

repro

If you can clarify how to repro I'm happy to look again and re-open 👌

@mjmasn
Copy link
Contributor Author

mjmasn commented Mar 19, 2019

@rickhanlonii hmm, it's broken on a variety of real devices in our office. Could be a specific Android version maybe? I haven't tried any emulators yet but will do so this afternoon. The issue does appear to be intermittent, sometimes after a few attempts it does trigger the onLongPress handler but it's probably 1 in 10 attempts or fewer.

I'm running Android 9 on a Samsung Galaxy S9+

@rickhanlonii
Copy link
Member

Ok cool, lmk if you can find a simulator to repro in 👍

@mjmasn
Copy link
Contributor Author

mjmasn commented Mar 19, 2019

Working on emulators:
Nexus_5X_API_25
Nexus_6P_API_26
Pixel_C_API_27
Pixel_2_XL_API_28

Working on real devices:
LGE Nexus 5 running Android 6.0.1 (API 23)
Huawei P8 lite 2017 running Android 7.0 (API 24)
LGE Nexus 5X running Android 8.1.0 (API 27)

Broken on real devices:
Samsung Galaxy A5 (2016) running Android 7.0 (API 24)
Samsung Galaxy S9+ running Android 9 (API 28)

Possibly a Samsung theme here but I don't have any other devices to hand. Would be helpful if other Samsung users could chime in...

@rickhanlonii
Copy link
Member

Hey @mjmasn, thanks for more testing!

Re-opening so we can test on those devices and figure out what's happening

@rickhanlonii rickhanlonii reopened this Mar 19, 2019
@mjmasn
Copy link
Contributor Author

mjmasn commented Mar 19, 2019

Thanks @rickhanlonii 👍

One final piece of information: the issue is also affecting <TouchableHighlight /> in the same way.

<TouchableOpacity /> and <TouchableWithoutFeedback /> are not affected.

@mjmasn
Copy link
Contributor Author

mjmasn commented Mar 19, 2019

@rickhanlonii hmm actually it looks like your commit here might have triggered this: 3bef4bd#diff-580446e098bcae0cd35585b8cf689f2aL501

Apparently that line was not just a perf optimisation 🙃

@nadavmos
Copy link

also affecting TouchableHighlight on iOS

@JanErikFoss
Copy link

JanErikFoss commented Mar 21, 2019

Yeah I'm having this issue on both iOS and android with TouchableHighlight.
Was working on 0.58.x
Issue after upgrading to both 0.59.0 and 0.59.1
iPhone X, iOS 12.2
Samsung Galaxy S8, android 8.0.0

@medelvann

This comment has been minimized.

@emilemoureau
Copy link

emilemoureau commented Mar 25, 2019

I'm having this issue too on iOS and Android! RN 0.59.1

iOS 12.1.4, iPhone X and Android 9.0, Pixel 3

@gaodeng
Copy link
Contributor

gaodeng commented Mar 26, 2019

RN 0.59.2 ,This bug still exists

@tikkichan4
Copy link

@rickhanlonii hmm actually it looks like your commit here might have triggered this: 3bef4bd#diff-580446e098bcae0cd35585b8cf689f2aL501

Apparently that line was not just a perf optimisation 🙃

FYI. Just forked a private repo to revert this commit. It is confirmed that commit causes the issue.

@Kida007
Copy link
Contributor

Kida007 commented Mar 30, 2019

was able to reproduce it on OnePlus 5t.

@saifali96
Copy link

@rickhanlonii is a fix for this set for an upcoming release?

@rickhanlonii
Copy link
Member

This is fixed by #24238

@RobTS
Copy link

RobTS commented Apr 3, 2019

Same here, OnePlus 6. #24238 solved the issue for me as well.

@mjmasn
Copy link
Contributor Author

mjmasn commented Apr 4, 2019

Fixed by 59e5023

@Kida007
Copy link
Contributor

Kida007 commented Apr 12, 2019

yes this is fixed in react-native@0.59.4

@theharness
Copy link

Just upgraded to 0.59.4, I'm still not getting the trigger for Pixel 2 on Android 9

@danielidt
Copy link

Confirmed broken on 0.59.10 on a Pixel 3 XL using TouchableOpacity

@danielidt
Copy link

danielidt commented Jul 31, 2019

Wanted to update, the issue on 0.59.10 only seemed to happen when remote-debugging was turned on, onPress would trigger onLongPress instead

However, after upgrading to RN 0.60.0, onLongPress on touchableOpacity is not working at all when using remote debugger.

works fine when not debugging

@mjmasn
Copy link
Contributor Author

mjmasn commented Jul 31, 2019

@danielidt this particular bug was fixed and the issue has been closed for a while. It sounds like you're experiencing a different problem so I'd recommend opening a new issue in this repo. I doubt you'll get any replies on this one.

@KBog
Copy link

KBog commented Feb 12, 2020

I wanted to report to whoever is seeing this on Android 10, I tried on Nokia 6.1 with react-native: 0.59.1 the onLongPress was triggering right away (even with a delay) -- but that was the case only when remote-debugging as @danielidt mentioned above.

Turning off the remote debugging worked fine without having to update the react-native packager. I left it at 0.59.1, and all works as expected.

@facebook facebook locked as resolved and limited conversation to collaborators Apr 4, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: TouchableNativeFeedback Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests