Forums

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

#252918
Mottie
Member

I think the event.handled works in the script I posted because the event is provided by a delegated binding, so the event is propagating up the DOM tree, so the event.handled flag remains.

Another idea, used by hammer-time (also the makers of hammer.js), is to add a touch-action:none; css property to the element – which does appear to be supported by all modern browsers now. Their script adds the style in-line, but I don’t see why you couldn’t toggle a class name to apply it.