In previous mobile applications that I developed, I found that the click event does not work properly in all devices (for example, in games in which the user had to quickly click on the screen, instead of triggering the click event, a double click was activated), and using touchstart gave the best results for what I wanted.
Since then, I started listening to the touchstart event instead of click ; but testing in Chrome, I received the following warning in the JS console:
Operations requiring explicit user interaction in touchstart events are deprecated and will be deleted in M54 around October 2016. See https://www.chromestatus.com/features/5649871251963904 for more details.
I visited the linked page (and the links inside it), and it seems that this new behavior is to avoid certain unwanted actions and, in particular, to avoid third-party iframes or ads (my application does not have) from opening pop-ups. I tried to change the event to touchend (as indicated in one of the links "The touchhend event will continue to behave as before"), but received a similar warning message.
And my questions are:
- Is it something that only affects Chrome, or will it affect my web applications (using Cordova / Phonegap) for Android and iOS?
- What event should be used to replace
touchstart and avoid problems that I encountered in the past? I could go back to click , but a quick click / click would still be a problem.
source share