Handling click delays
We have seen that a mobile application can support various touch gestures. With the introduction of new technologies, differences between web apps and native mobile apps are getting close to zero, but not actually zero. One such difference is how click events are handled in mobile apps.
When you click on a button, mobile browsers wait for 300 ms to actually trigger the click event for the button that you have clicked. The actual reason is that the mobile browser waits to see whether the user wants to perform a click or a double click. After the 300 ms delay, if there is no other tap, it's considered as a single click. However, if there are no event handlers for double clicks, the delay will be unnecessary. By overcoming these delays, you can make your app more responsible and less laggy.
We are going to see an approach to avoid this 300 ms delay using the library called FastClick that is available at https://github.com/ftlabs/fastclick. The steps are as follows:
Include...