This is a migrated thread and some comments may be shown as answers.

$(document.body).kendoTouch() only works in initial view on iPhone

3 Answers 109 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 20 Jun 2013, 01:58 AM
Hi,

I am trying to listen to a swipe event across my entire Kendo mobile application. My best attempt is as follows:

$(document.body).kendoTouch({
    enableSwipe: true,
    minXDelta: 20,
    swipe: function(e) {
        console.log("swipe " + e.direction);
        alert("swipe " + e.direction);
        if(e.direction == "right") {
            if(app.pane.history.length > 1){
                app.navigate("#:back");
            }
        }
    }
});

This works in the graphite simulator and on android devices. However, on an iPhone the event is only fired on the initial view before navigating anywhere. After navigating to another view it no longer fires, even when returning to the initial view. I figure the event handler is dropped after the DOM is modified but it's hard to debug on the iPhone.

I did get this working by rebinding this event handler to the body every time the application viewShow event fired, but this didn't seem right and I think I noticed a hit to performance.

Is this a bug with Kendo mobile or is there a better way to go about this? I want to avoid having to wire up each of my views individually if possible.

Regards
Dean

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 21 Jun 2013, 03:26 PM
Hi Dean,

I have simulated the case you are describing using our TabStrip demo and the code you provided for handling the swipe events. I had it deployed on an iOS device and all the swipe events were correctly handled, even after changing views. Here is a JSBin with my code:

http://jsbin.com/ajukeq/1/edit

Can you please compare it with what you have developed or make it simillar to your application, so we can see, when the problem occurs.

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dean
Top achievements
Rank 1
answered on 23 Jun 2013, 11:28 PM
Hi Kiril,

Thank you for your response. I copied your JSBin code into a new icenium project and slowly added bits of code from my application until it stopped working, then removed code until it started working again. After some time I've narrowed it down to simply adding  the "transition: slide" option when initialising the kendo mobile application.

So, if you just change this
var app = new kendo.mobile.Application(document.body);
to
var app = new kendo.mobile.Application(document.body, { transition: "slide" });
and test on an iPhone you should experience the behaviour I described in my first post.

Regards
Dean
0
Accepted
Kiril Nikolov
Telerik team
answered on 24 Jun 2013, 04:38 PM
Hello Dean,

Indeed this is a bug, I have managed to reproduce it on my end too. This issue will be addressed in one of our next releases. I would suggest you to keep an eye on the Internal Builds that we release on a regular basis.

As a gesture of gratitude for bringing this to our attention I have added some telerik points to your account. 

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Dean
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Dean
Top achievements
Rank 1
Share this question
or