8

If I use something like $('button').click(function() { alert('hi'); } and I add the following to my <head>:

<meta name="viewport" content="user-scalable=no, width=device-width">

..and I run it as a normal mobile site on iOS 11, there is no delay (=> expected behaviour).

However, if I run the exact same code in a compiled Cordova hybrid app on iOS, the delay is back! (=> not good)

Do I have to start using fastclick.js or some other workaround again like it's 2013? What about other Cordova developers on here: do you experience the same problem?

PS: It works fine on Android.

PPS: Adding touch-action: manipulation; in CSS doesn't help unfortunately

Tonald Drump
  • 1,227
  • 1
  • 19
  • 32

2 Answers2

4

About the fastclick issue, apparently, it's a new bug introduced with iOs 11.3.

Here is the full explanation

And here is a fork which resolves the fastclick issue with iOs 11.3

I'm also looking for a workaround, since fastclick doesn't look to be maintained anymore...

Romain Le Qllc
  • 856
  • 1
  • 6
  • 10
3

We experience the exact same problem.

Using FastClick as a workaround works for most iOS versions, except for the latest iOS release: 11.3. After a fresh start of a Cordova app, FastClick works as expected but after a while (especially when calling native iOS calls like taking a photo), it shows weird behaviour where your input fields (nested in other divs) do not get selected at all and you have to tap multiple times to select an input field.

I have no clue why the 350ms delay is still active for (Cordova) apps and not for a standard mobile website opened in Safari.

Thanks to the tip from Romain Le Qllc, I replaced fastclick with the fork that he mentioned (https://github.com/lasselaakkonen/fastclick). This resolves the issues in both iOS 11.3 and 11.4.

Also big thanks to lasselaakkonen.

pj3s
  • 101
  • 6