最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Cordova adds 350ms delay on click() events in iOS - Stack Overflow

programmeradmin1浏览0评论

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 piled 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

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 piled 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

Share Improve this question asked Mar 16, 2018 at 14:12 Tonald DrumpTonald Drump 1,3861 gold badge21 silver badges38 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 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...

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./lasselaakkonen/fastclick). This resolves the issues in both iOS 11.3 and 11.4.

Also big thanks to lasselaakkonen.

发布评论

评论列表(0)

  1. 暂无评论