0

I have some simple buttons in a webapp that open some map layers when clicked. They work as expected on all modern desktop browsers an on Androids, but on iOS the buttons need to be really pressed down, instead of just touched....

The click/touch events have the syntax:

$(".btns").on("touchstart  click", function() {
  ...});

...maybe this 'touchstart click' syntax is not the best? I got this idea from SO... Thoughts? (PS: My co-worker just pointed out, I do not have any 'e.stopPropagation' or 'e.preventDefault' code added to the event handler...I will try that, but I would still like to hear what the SO community thinks!)

JasonBK
  • 539
  • 3
  • 12
  • 37

1 Answers1

0

This seemed to be enough to stop that behavior:

$(".btns").bind("click", function() {

..I think adding 'touchstart click' as events was causing each touch on an iPhone to trigger two events....

If anyone else ha anoy other ideas about this or explanations, please post!

JasonBK
  • 539
  • 3
  • 12
  • 37