-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
onLongPress (and delayLongPress) triggers immediately #4944
Comments
Hey yonatanmn, thanks for reporting this issue! React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
|
Duplicate of this? #4088 |
Looks like the same problem, |
+1 when i debugging in chrome i see this behavior. |
similar thing happens for |
I tried to investigate this problem but could not replicate the behaviour. I used the example code provided by @yonatanmn and the onPress and onLongPress fired as expected. Is there more to this, or has it been fixed? |
Confirming that this happens only with chrome debugger enabled. |
Also confirming that this happens only with chrome debugger enabled. |
Same. Confirming that this happens only with chrome debugger enabled. |
I've just tested that and it looks like it's reversed now ;) Without debugging tools the longPress triggers after holding for ~500-600ms, but with Chrome debugging open you need to wait ~3400ms. I don't know whether it's a bug or a feature, but it seems that the original problem (launching onLongPress instead of onPress) has been solved. |
ExceptionsManager.js:71 Attempted to transition from state |
Hmm it randomly started happening, after testing on real device with RN Debugger. it was working fine, and suddenly stopped working, onLongPress is being called on quick single tap instead of onPress. |
Im seeing this issue too. |
@brentvatne @satya164 How can I help? (I'm seeing this, and it's causing me issues with my workflow, and also may be resulting in the app just randomly exiting). |
i am seeing this issue as well |
I've just encountered this issue as well when debugging on Android. React Native
DELAY fires Also, notice that DELAY and LONG_PRESS_DETECTED is so close together - that's because the two setTimeout calls are made simultaneously but with different timeouts (130, 600). However, this bug makes them fire really close together, and sometimes flipped around, which causes bugs like #1693 which @zyxcambridge mentioned above This is with no debugging, which is much more reasonable:
|
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally! If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution. |
it's been inactive but still happening and should not be closed. it's even worse lately when using react-native-router-flux because it brings up a red box when transitioning between scenes with the error mentioned by @zyxcambridge |
I started seeing this today too...using react native, and RNRF too. |
Confirmed.. this is still happening. Only when dev tools is connected tho. |
Yes still happening.. (i am on ios) |
The opposite happens to me. onLongPress takes around 2 seconds to fire, regardless of delayLongPress time. If I turn off remote debugging it is working as expected. Edit: Actually in my case it was a firebase async call that caused the delay. |
+1 happening only with chrome debugger. I hope this doesn't happens in production. |
A competition |
hello,I am go away! |
forgive |
Ah, I thought I broke everything. Thankfully it's just because of Chrome debugger. Works fine when I disable debugger. (Using Expo) |
Still having this issue and only happen when connected to Chrome debugger. |
This breaks only when debug JS remotely is enabled. im using VSCode debugger. |
maybe a obvious mistake on my part but i was not passing onLongPress a function initially i was declaring a method instance which caused it to fire on load.
whereas it should be
|
@apn-james both of those should be ok (what might be missing in the first is a bind function unless that is an arrow function instance). Did you write the first call with parans maybe?
|
@ricklove true i did pass params and did not bind the first instance. |
The same problem while remote debugging. |
Still happening randomly (but at high frequency) on external device when remote debbuger is on. Tested it on Android devices only not sure if it happens on iOS. |
For some reason (I have no clue why)
onLongPress
triggers immediately, and onPress doesn't.tested on : android simulator with genymotion (galaxy5) and real galaxy3 device
After adding
delayLongPress
i figured out that it's "stealing" 1000ms from the delay, and I guess the default delay is 1000, so it's triggering immediately.for example :
when I calculate :
onLongPress time - onPressIn time
, I get ~2800
mswithout
delayLongPress
or withdelayLongPress={1000}
I get10
-20
msThe text was updated successfully, but these errors were encountered: