On-swipe-left and on-swipe-right only triggering with long movements

Hi guys!

I’m using the following template:

<div class="radio-wrapper" on-swipe-left="left()" on-swipe-right="right()"></div>

But when i use a small movement the swipe does not trigger. It triggers only when I’m swiping from one side of the screen to another.

Any ideias?

Problem solved using touchstart, move and end events.

Just a heads up, Ionic has built in gestures that you can use in your directives.


As I can see you could solve your problem about long movements on swipe using touchstart, move and end events.
I have exactly the same problem, and I need short movements on swipe. Can you help me with any sample ?

thanks in advance.

I’ve created a directive and here it is the link function:

      link: function(scope, element, attrs, ngModel) {
            var startX;
            element.on('touchstart', function(e) {
                startX = e.touches[0].pageX;

            element.on('touchmove', function(e) {

            element.on('touchend', function(e) {
                var diff = startX - e.changedTouches[0].pageX;
                if(diff > 0) {
                else if (diff < 0) {