How can I prevent side pull (left/right) on ‘accident’?

Ask for help relating to our Sencha Touch based Scheduler (for iPad, or any other supported phone, phablet or tablet)
Post Reply
User avatar
chri5tian
Posts: 9
Joined: Fri Oct 09, 2015 3:22 pm

How can I prevent side pull (left/right) on ‘accident’?

Post by chri5tian »

Our user scroll horizontally (swipe) over several days within the visible timeline. However, doing this too fast, will trigger the pull event once the edge of the timeline is reached. My users call that an unintended pull. However, an intended pull is still required. One approach would be, to set a timeout on the pull/release event and only execute the timeline update if the timeout has expired.
To you have any idea on how-to accomplish that?
Thanks

User avatar
Maxim Gorkovsky
Core Developer
Core Developer
Posts: 3290
Joined: Wed Jan 08, 2014 11:46 am

Re: How can I prevent side pull (left/right) on ‘accident’?

Post by Maxim Gorkovsky »

Hello.
Take a look at PullRefresh feature. I think what you need is to make onScroll to be called after some timeout. Try:

Code: Select all

_onScroll : function (side, val) { 
// this should be old onScroll method;
}
onScroll : function (side, val) {
    this._timeout = setTimeout(function () { this._onScroll(side, val); }, 1000);
},
onScrollerDragEnd : function () {
   this.callParent(arguments);
   clearTimeout(this._timeout); // cancel call
}

User avatar
chri5tian
Posts: 9
Joined: Fri Oct 09, 2015 3:22 pm

Re: How can I prevent side pull (left/right) on ‘accident’?

Post by chri5tian »

This solved my problem :-)
Thank you Maxim

Post Reply