2

I have an Ember.View that handles both the click and touchEnd events, for both desktop and mobile interactions.

Unfortunately, touchEnd also gets fired when scrolling, which is not intended. How do I handle the click and tap, but avoid the scroll event?

Ember.View.extend({
  click: function() {
    // not handled in a mobile browser
  },
  touchEnd: function() {
    // handled in a mobile browser, but unfortunately also on scroll
  }
});
Josh Smith
  • 14,674
  • 18
  • 72
  • 118

1 Answers1

1

Instead of adding handlers for both click and touchEnd, use the fastclick library. Now you just need to add a handler for the click event. If your using ember-cli, there is an addon for this.

blessanm86
  • 31,439
  • 14
  • 68
  • 79