This is a strange one. I have a delegated 'click' event that doesn't seem to work on iOS. But if I change the event to 'click touchstart', it works. See below:
$('body').on 'click touchstart', '#cartut-proddetail', ->
$(@).fadeOut -> $(@).remove()
$('#cartut-overlay').fadeOut -> $(@).remove()
Basically, #cartut-proddetail
is an overlay behind a modal. So when the user taps off the modal, I want to remove all overlays. Without touchstart
, though, nothing happens. Why is that? Other click
events work just fine on iOS, and I never had to use touchstart
before (this is literally the first time). Why doesn't click
by itself work?