MilesHD
MilesHD

Reputation: 23

swipe-down event not firing - ionic framework

I am creating a simple app with the ionic framework, and I want to run a function on each of the swipe events. Swipe Up, down, left, and right.

    <ion-content on-swipe-up="add()" on-swipe-left="multiply()" on-swipe-right="divide()" on-swipe-down="subtract()" scroll="false">
    <div id="game">
        <h1>{{subject.value}}</h1> 
    </div>
</ion-content>

All of the events work fine, except on-swipe-down. No matter what I do, I cannot get that event to fire. I have tried everything I can think of: setting the scroll property, attaching the events to different elements, emulating instead of in the browser, and have made a new bare-bones project where I'm just testing the on-swipe-down event. Nothing has worked.

CorePen

Upvotes: 2

Views: 2771

Answers (1)

Andrew McGivery
Andrew McGivery

Reputation: 1390

Looks like there is a bug.

I filed a Github issue. https://github.com/driftyco/ionic/issues/1810

In the meantime, if you use a local copy of the bundle.js file, make the following change:

Line 40918, change:

'onHold onTap onTouch onRelease onDrag onDragUp onDragRight onDragDown onDragLeft onSwipe onSwipeUp onSwipeRight onSwipeBottom onSwipeLeft'.split(' '),

to

'onHold onTap onTouch onRelease onDrag onDragUp onDragRight onDragDown onDragLeft onSwipe onSwipeUp onSwipeRight onSwipeDown onSwipeLeft'.split(' '),

Upvotes: 2

Related Questions