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

Listview tap and hold

5 Answers 157 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
OfficeHeart
Top achievements
Rank 1
OfficeHeart asked on 29 Nov 2012, 03:21 PM
Hello,

I have a listview with tap and hold events:
- onTap: navigate to something
- onHold: show actionsheet

Now after the hold event, the tap event is also generated. How can I cancel that event?

Here is the jsBin http://jsbin.com/egasev/1/edit

Thanks,
Koen

P.S. Maybe you can make a Touch forum for these questions.


5 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 30 Nov 2012, 03:35 PM
Hello Koen,

I am afraid what you are trying to achieve is not supported in Kendo UI Mobile. We may consider changing this for future versions in the product, but at this point there is no suitable workaround I can suggest. Please excuse us for the inconvenience caused. 

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Accepted
Iliana Dyankova
Telerik team
answered on 30 Nov 2012, 05:46 PM
Hi Koen,

After further discussions with the team I am glad to say we managed to find a workaround that may suit your requirements. Take a look at the following code snippet: 

<script>
  var hold;
  function onTouchStart(e){
      hold = false;
  }
   
  function onTap(e) {
    if (!hold) {
        alert('tap');
    }
  }
   
  function onHold(e) {
     hold = true;
     alert('hold');
     $("#companyActionsList").data("kendoMobileActionSheet").open();
 }
  window.kendoMobileApplication = new kendo.mobile.Application(document.body);
</script>

In the touchStart event assigned false value to the hold variable and made some additional checks. For your convenience I updated the jsBin example to illustrate the suggested approach in action.

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sergey
Top achievements
Rank 2
answered on 21 Jul 2014, 06:20 PM
Hello, I've faced with this issue, is it already solved or I have to use this workaround?
0
Kiril Nikolov
Telerik team
answered on 22 Jul 2014, 03:33 PM
Hello Sergey,

You still need to workaround that my colleague provided, as the tap event is fired right after the hold event is completed.

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
Sergey
Top achievements
Rank 2
answered on 25 Jul 2014, 12:13 PM
Thanks for response, however it's a pity, that you need more then two years to fix such a widespread bug.
Tags
ListView (Mobile)
Asked by
OfficeHeart
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Sergey
Top achievements
Rank 2
Kiril Nikolov
Telerik team
Share this question
or