The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Touch device ghost click triggers on different element Reply To: Touch device ghost click triggers on different element


Looking at the answers on SO, I believe most of these script work because of using preventDefault() on touchstart. The only touch event for which it will have a cross browser reliably effect that will prevent it getting emulated into a click. Going with touchstart and click is the shortest route of course, although all native behaviour (scroll, swipe) will be disabled when starting the interaction on the element in question.

It’s going a bit out of the scope of the original issue but the custom event I put together has a shortcoming as well that is in the same sphere. Which is that if you happen to touch an element with the event listener and start scrolling, after removing the finger the event might get triggered. I may have to add a solution for that (likely awkward and overly complicated with Android again) on the page that had the issues.

Some good info for future reference: