Listview tap and hold

6 posts, 1 answers
  1. OfficeHeart
    OfficeHeart avatar
    99 posts
    Member since:
    Aug 2008

    Posted 29 Nov 2012 Link to this post

    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.


  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 30 Nov 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Answer
    Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 30 Nov 2012 Link to this post

    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!
  5. Sergey
    Sergey avatar
    2 posts
    Member since:
    Feb 2013

    Posted 21 Jul 2014 Link to this post

    Hello, I've faced with this issue, is it already solved or I have to use this workaround?
  6. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 22 Jul 2014 Link to this post

    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!
     
  7. Sergey
    Sergey avatar
    2 posts
    Member since:
    Feb 2013

    Posted 25 Jul 2014 in reply to Kiril Nikolov Link to this post

    Thanks for response, however it's a pity, that you need more then two years to fix such a widespread bug.
Back to Top
Kendo UI is VS 2017 Ready