-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Clicks stop working on iOS 11.3 after resuming #549
Comments
Thanks so much for this. A massive life saver! 🥇 |
Thank you!!!! |
Thank you, life saver |
Very thank you, solve my problem |
@lasselaakkonen Awesome Thank you!!! Question: I looked at your branch's diff: why are you checking for iOS 11.3 specifically?
Shouldn't we just use |
@benmcmaster I do not know how sensitive FastClick is to the changes in timestamps and I do not know how how much of a difference there can be between I am hoping it will be fixed in in iOS 11.4. And it might already be fixed, because I think I had iOS 11.4 beta installed on a device and I could not replicate the issue on that .. if I remember correctly. I could verify that. |
line 336 you have a bug: should read
|
Thank you all!!!! |
@vahvarh I have not modified that line. (Offtopic: but if you are referring to |
@lasselaakkonen |
The comment said "iOS 11.3 returns negative values for event.timeStamp after pausing/resuming a Cordova application". If that is true, what about this fix? |
It's great that there's a workaround for this! Has anyone filed a bug at the WebKit project bug tracker (https://bugs.webkit.org) or Apple's bug tracker (https://bugreport.apple.com)? |
I filed https://bugs.webkit.org/show_bug.cgi?id=185040, I am looking into this bug. Thanks. |
In my case, // if (event.timeStamp - this.lastClickTime < this.tapDelay) {
if (event.timeStamp - this.lastClickTime < this.tapDelay && event.timeStamp > this.lastClickTime) {
event.preventDefault();
} |
@cdumez Thank you for looking in to the issue and fixing it in WebKit. Do you know how WebKit/iOS releases work, when can that fix be expected to be released? The issue has now been reproduced on iOS 11.3 (at least by me and many others in this thread on multiple devices) and iOS 11.4 beta (at least by @sergetk). The I have removed the iOS 11.3 detection from my branch and now the trickery is done like this in
And
@zmen I believe that is related to another issue, which also causes the negative timestamps, but does not break FastClick completely. When timestamps are smaller after resuming, than before pausing, those (For some inexplicable I was not able to reproduce the bug now with FastClick in my app... I was getting negative timestamps, but clicks were still working. I'm not sure what was going on, but those latest changes to FastClick should not break any existing behavior, if platforms return correct timestamps.) |
@lasselaakkonen: Unfortunately, Apple does not comment on when a particular fix will ship to customers. |
is there an example of a fully updated working version of fastclick? |
@AlexPashley there is a fork which fixes this issue #550 |
Is anyone still having this issue even after taking the fix? I haven't been able to narrow it down, but after doing some exhaustive testing, there still seems to be some instances in where the clicks aren't working. Also, this.isTrackingClickStartFromEvent never seems to be reset once it's set to true. Could this create a scenario where you're comparing different "timestamps" in the onTouchEnd to determine if there has been a "click"? |
@gyoong2 Have you found some specific scenario where the I'm sure this is still an issue:
.. but I haven't looked in to it, I'm guessing it might break a click immediately after resuming? |
@lasselaakkonen 'timestamps are smaller after resuming' also occurred in my cases, after several tests. |
@lasselaakkonen - I have not explicitly seen when |
The value of lastClickTime only gets updated in onTouchEnd, after the value of lastClickTime is already compared to touchEndTime. The value of lastClickTime is originally based on the event.timeStamp. When the event.timeStamp comes through as negative, the new value of touchStartTime can no longer be validly compared to the timeStamp, and the function will (often) return before lastClickTime can get updated. The same issue will manifest, until after the value of touchEndTime exceeds the original value of lastClickTime. Setting lastClickTime to 0 when switching over to get a value based on getTime will help to avoid this. When switching over to the non-event.timeStamp value, lastClickTime should only be set to 0 once. All time comparisons from then on out should be made against a point in time, obtained when switching over, and compare milliseconds since that time. This work was based on a pull request from @lasselaakkonen and is a fix to issue 549. ftlabs#550 ftlabs#549
I've added a pull request based on the one by @lasselaakkonen I was still experiencing the problem after #550 but thanks to that pull, I was able to understand where the complete fix for my issue was. |
…3 hang on resume. See ftlabs/fastclick#549
Even after trying both @lasselaakkonen and @Saintless patches, my client is still reporting the same issue. Anyone else found that it doesnt solve the problem? |
@willcalderbank yes, I'm still seeing the problem after using this latest code. I'm trying to insert some instrumentation so I can figure out what's going on... |
By the way, the first iOS 12 developer seed came out yesterday and it would be good if you could confirm that the bug is completely fixed in the seed. Thanks. |
…g event timestamps in iOS11.3+. See: ftlabs#549
@cdumez I cannot replicate the issue with the iOS 12 developer preview. (Using the published fastclick package |
I'd also like to point out that as long as my device was connected to a Mac computer through USB, I could not reproduce the issue (since this is a timestamp issue, I'm guessing iOS was utilizing the timestamp from the computer during those wake events - not sure about this). As soon as I disconnected the USB cable and tried the steps from OP, I was able to reproduce the issue. |
Please try out the fix in #564 and report back success/fail. I don't have the resources to fully test it myself but I just wanted to try a slightly different attack at the problem |
So what does it say ? Has it been fixed ? In which ios version ? |
I already provided the WebKit bug report earlier in this thread. I also mentioned that my fix went into iOS 12. @ksibod also reported he could no longer reproduce the issue with iOS 12. |
Is this version available now, Still I see old changes on master branch. |
Any news? |
I have reproduced this issue with a Cordova app using UIWebView on iOS 11.3 on multiple devices.
According to this discussion, this issue applies to mobile Safari as well:
http://forum.framework7.io/t/ios-11-3-phonegap-resume-problem/2912
To reproduce the issue with Cordova:
-> click events are triggered with
event.timeStamp
as a negative numberThe negative timestamp is then incremented in successive clicks and clicking starts working when the number has increment above 0.
Framework7 has fixed the issue here:
framework7io/framework7@ac02ad1
I have forked this project and fixed the issue in a similar way here:
https://github.com/lasselaakkonen/fastclick/tree/fix-ios-11-3-event-timestamps
I am not familiar with FastClick internals, are there going to be any issues with using the current time as a timestamp, instead of reading it from the event?
The text was updated successfully, but these errors were encountered: