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

Disable FastClick on iOS 8 #262

Closed
matthew-andrews opened this Issue Jun 4, 2014 · 21 comments

Comments

Projects
None yet
10 participants
@matthew-andrews
Member

matthew-andrews commented Jun 4, 2014

As it's not longer needed (when appropriate meta tags are there)

@jasonhr13

This comment has been minimized.

jasonhr13 commented Jun 4, 2014

What are the appropriate meta tags?

@rowanbeentje

This comment has been minimized.

Member

rowanbeentje commented Jun 4, 2014

Worked with just <meta name="viewport" content="width=device-width, initial-scale=1"> in the simulator :)

@jasonhr13

This comment has been minimized.

jasonhr13 commented Jun 4, 2014

I have on a device and still get the delay

@jasonhr13

This comment has been minimized.

jasonhr13 commented Jun 4, 2014

I have content="user-scalable=no, initial-scale=1, width=device-width"

Still getting the delay

@rowanbeentje

This comment has been minimized.

Member

rowanbeentje commented Jun 4, 2014

We've sacrificed a device to confirm this - hopefully this isn't just a simulator thing (compared to the 7.1 simulator which was still showing the delay)

@rowanbeentje

This comment has been minimized.

Member

rowanbeentje commented Jun 4, 2014

False alarm. iOS 8 simulator: fast clicks. iOS 7 simulator: slow clicks. iOS 8 device: slow clicks.

@yungsters

This comment has been minimized.

yungsters commented Jun 24, 2014

How did you measure the delay on iOS 8? I see the delay using the iOS Simulator on iPhone 5S with 8.0 (12A4297e). I used this test page: http://www.yungsters.net/clickdelay.html

Edit: Further testing reveals (on the iOS 8 Simulator) that the click delay only occurs if the time between touchstart and touchend lasts less than 125ms.

@alexgibson

This comment has been minimized.

alexgibson commented Sep 18, 2014

Edit: Further testing reveals (on the iOS 8 Simulator) that the click delay only occurs if the time between touchstart and touchend lasts less than 125ms.

I can confirm this behavior on a real device (iPhone 5 running yesterday's iOS8 release version). As long as the touchstart and touchend events don't happen really close together, the click delay is gone (seeing times as low as 2ms). This is happening in Safari (regardless of the meta viewport settings for the page). UIWebView seems to still have the delay however. Not sure about the "new" web view.

You can test here: http://www.quirksmode.org/m/tests/clickdelay.html

@matthew-andrews

This comment has been minimized.

Member

matthew-andrews commented Sep 18, 2014

That is weird and WebView having delay & Safari not is super annoying

I suspect the best thing to do for now would be to keep FastClick active on iOS 8 until the WebView is fixed (unless there is a way to detect those cases). @rowanbeentje what do you think?

@rowanbeentje

This comment has been minimized.

Member

rowanbeentje commented Sep 18, 2014

User agent is the same in each, I think... we could detect homescreen UIWebView usage by testing for IndexedDB but in-app UIWebView and WKWebView have it I think.

The whole short-touch-still-slow is also an odd one. I fear we might need to leave it active for now.

@firtman

This comment has been minimized.

firtman commented Sep 18, 2014

On my iPod Touch iOS 8 final Build (12A365), I still have the 300ms delay on Safari.

@alexgibson

This comment has been minimized.

alexgibson commented Sep 18, 2014

On my iPad (4th gen) I am also seeing the same low delay times as reported in my previous comment.

@matthew-andrews

This comment has been minimized.

Member

matthew-andrews commented Sep 19, 2014

@firtman do you not get the variable behaviour? Short taps delayed, long taps instant?

@alexgibson

This comment has been minimized.

alexgibson commented Sep 21, 2014

I think a lot of folks are caught out by the short-tap behavior and do not test this change carefully enough. Seems pretty consistent here. The one thing I haven't been able to test is the "new" web view in iOS8. Hopefully this one matches Safari.

@patrickhlauke

This comment has been minimized.

patrickhlauke commented Sep 22, 2014

am i dreaming or is there some weird thing going on in iOS8 where it doesn't actually fire a click now? testing this http://patrickhlauke.github.io/touch/tests/event-listener.html I just noticed that it only seems to fire mouseover, mouseenter and mousemove compatibility events. edit: it seems more heuristics at work here... https://twitter.com/rowanbeentje/status/514002790868602881

@patrickhlauke

This comment has been minimized.

patrickhlauke commented Sep 22, 2014

can confirm that the speed of a tap does indeed determine whether or not the 300ms delay happens or not. hurrah for opaque undocumented heuristics that are not communicated to developers! edit: small video for those who haven't experienced it directly https://www.youtube.com/watch?v=k-UiuPp2CK0

@mgol

This comment has been minimized.

mgol commented Sep 23, 2014

@rowanbeentje UIWebView doesn't have IndexedDB, in-app or not. It also doesn't fire events during scrolling which Safari does.

@rowanbeentje

This comment has been minimized.

Member

rowanbeentje commented Sep 23, 2014

@mzgol Which is, at least temporarily, a good way to detect UIWebView versus the others, even though it has the same user agent :) But let's all hope that gets changed soon anyway....

@tjvantoll

This comment has been minimized.

tjvantoll commented Sep 23, 2014

I can confirm that WKWebView uses the new heuristics found in Safari... and that UIWebView does not. This is crazy.

@patrickhlauke

This comment has been minimized.

patrickhlauke commented Sep 24, 2014

not sure if relevant for fastclick itself, but thought i'd share this little nugget of additional iOS8 slow tap heuristic weirdness:

  • in iOS 7 and earlier, cancelling a touchend (with preventDefault for instance) suppresses mouse compatibility + click events - see https://www.youtube.com/watch?v=HmXvwYcFkps - this also works same way for cancelling touchstart (cancelling touchmove has been inconsistent...in some other platforms/browsers it has the same effect, but not on iOS)
  • in iOS 8, cancelling touchstart works as before...but when it comes to cancelling touchend, if the user performs this new "slow tap", mouse compatibility + click events ARE being fired despite the preventDefault - see https://www.youtube.com/watch?v=i787lZCL_YQ

Edit: confirming that this is a bug in WebKit https://bugs.webkit.org/show_bug.cgi?id=137069

kaldari added a commit to wikimedia/mediawiki-extensions-MobileFrontend that referenced this issue Oct 31, 2014

Tap code be gone!
ios8 [1] has no need for it, neither does Chrome mobile [2]
The existing code doesn't work on IE8 or Blackberry touch/mouse wheel
devices

[1] ftlabs/fastclick#262 (comment)
[2] http://updates.html5rocks.com/2013/12/300ms-tap-delay-gone-away

Bug: 72566
Bug: 72645
Change-Id: I049f9ec51f972f595bb6555c5528debb21e4c489

wmfgerrit pushed a commit to wikimedia/mediawiki-extensions that referenced this issue Oct 31, 2014

jenkins-bot Gerrit Code Review
Updated mediawiki/extensions
Project: mediawiki/extensions/MobileFrontend  d620ae12c82a72f9ec5c3547365a4e542c0f16c8

Tap code be gone!

ios8 [1] has no need for it, neither does Chrome mobile [2]
The existing code doesn't work on IE8 or Blackberry touch/mouse wheel
devices

[1] ftlabs/fastclick#262 (comment)
[2] http://updates.html5rocks.com/2013/12/300ms-tap-delay-gone-away

Bug: 72566
Bug: 72645
Change-Id: I049f9ec51f972f595bb6555c5528debb21e4c489

@akrymski akrymski referenced this issue Feb 4, 2015

Closed

iOS 8 tap issues #11

@KJTsanaktsidis

This comment has been minimized.

KJTsanaktsidis commented Feb 24, 2015

We found that this issue was causing double clicks to be triggered on our labels (because we hacked fastclick to not needclick on labels). We found adding some code similar to the following to fastclick where the event was being dispatched helped:

var clickListener = function (ev) {
    if (!ev.forwardedTouchEvent) {
        ev.preventwindoDefault();
        ev.stopPropagation();
        return false;
    }
};
targetElement.addEventListener('click', clickListener);
setTimeout(function(){
    targetElement.removeEventListener('click', clickListener);
}, 310);
event.preventDefault();
this.sendClick(targetLabel, event);

Might it be worth doing something similar in fastclick?

KJTsanaktsidis added a commit to StileEducation/fastclick that referenced this issue Feb 24, 2015

Fix iOS 8 dispatching native clicks shortly after fastclick
If a click is a long click, then iOS 8 will dispatch a native click
which cannot be cancelled. This is causing our checkboxes to be checked
twice for medium-length clicks. This listens for and cancels this native
click.

See ftlabs#262

KJTsanaktsidis added a commit to StileEducation/fastclick that referenced this issue Feb 24, 2015

Fix iOS 8 dispatching native clicks shortly after fastclick
If a click is a long click, then iOS 8 will dispatch a native click
which cannot be cancelled. This is causing our checkboxes to be checked
twice for medium-length clicks. This listens for and cancels this native
click.

See ftlabs#262

KJTsanaktsidis added a commit to StileEducation/fastclick that referenced this issue Feb 24, 2015

Fix iOS 8 dispatching native clicks shortly after fastclick
If a click is a long click, then iOS 8 will dispatch a native click
which cannot be cancelled. This is causing our checkboxes to be checked
twice for medium-length clicks. This listens for and cancels this native
click.

See ftlabs#262

mex added a commit to Fitbay/fastclick that referenced this issue May 27, 2015

Fix iOS 8 dispatching native clicks shortly after fastclick
If a click is a long click, then iOS 8 will dispatch a native click
which cannot be cancelled. This is causing our checkboxes to be checked
twice for medium-length clicks. This listens for and cancels this native
click.

See ftlabs#262

Credit to StileEducation@38cf9b9

mex added a commit to Fitbay/fastclick that referenced this issue May 27, 2015

Fix iOS 8 dispatching native clicks shortly after fastclick
If a click is a long click, then iOS 8 will dispatch a native click
which cannot be cancelled. This is causing our checkboxes to be checked
twice for medium-length clicks. This listens for and cancels this native
click.

See ftlabs#262

Credit to StileEducation@38cf9b9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment