Why/when do I have to tap twice to trigger click on iOS Why/when do I have to tap twice to trigger click on iOS ios ios

Why/when do I have to tap twice to trigger click on iOS


I had this same issue. The simplest solution is not to bind the mouseenter event on iOS (or any touch enabled target platform). If that is not bound the hover event won't get triggered and click is triggered on the first tap.


iOS will trigger the hover event if an element is "display: none;" in the normal state and "display: block;" or inline-block on :hover.


I solved this issue by first detecting if it was an iphone, then binding the mouseup event to the function I was trying to call.

if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))){     $('foo').on('mouseup', function(){        ...    }}

I tried other events but mouseup seemed to work best. Other events like touchend were firing even if the user was trying to scroll. Mouseup doesn't seem to get fired if you drag your finger after touching.

Credit David Walsh (and ESPN) for the iPhone detection. http://davidwalsh.name/detect-iphone