Search code examples
javascriptioscordovadelayphonegap

Cordova adds 350ms delay on click() events in iOS


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


Solution

  • 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...