[CLOSED] Avoid itemtap after itemtaphold

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Avoid itemtap after itemtaphold

    Is there a common way of avoiding itemtap being fired after itemtaphold?
    Last edited by fabricio.murta; Jan 21, 2017 at 3:00 PM. Reason: no user feedback for 7+ days
  2. #2
    I found a "dirty" way to do it, but I think it should be built into extjs.

        // regTapHold should be called from the itemtaphold handler.
        function regTapHold(e) {  
            e._tapHold = true;
        }
    
        // checkTapHold should be called from the itemtap handler, 
        // and if this function returnes true, then skip further execution in that handler. 
        function checkTapHold(e) { 
            if (e._tapHold == true) {
                e._tapHold = false;
                return true;
            } return false;
        }
  3. #3
    Hello @sveins12! And thanks for sharing the solution that works for you.

    Seems there's not much discussion about this around, at least I couldn't find it. And I'm not completely sure in which scenarios that would be a problem, but sounds like an useful feature, for example, to show tooltips on a button when using mobile devices -- quick tap triggers it, and long tap just shows an explanation on what the button does.

    I'm not sure about how "portable" across browsers is your approach, maybe that would be the main issue about handling the different tap behaviors.
    Fabrício Murta
    Developer & Support Expert
  4. #4
    Usually I would like one behavior to occur when tapping quickly and another behavior when the user is holding down an item for a long time.

    The problem is that itemtap is always fired when releasing the finger after a long-tap.

    Maybe itemtap is not the correct event to use when tapping an item quickly/normally? Is there another event for this, which is not always fired when releasing the finger?

    I have seen other discussions about this in the Sencha Touch forums, but I haven't found an acceptable solution there. By the way my solution is standard JavaScript, and I think it should work on all the browsers that support Extjs. But offcourse I don't know if it will mess up other touch events.
    Last edited by sveins12; Jan 10, 2017 at 8:57 PM.
  5. #5
    Hello @sveins12!

    What component exactly are you using as base for the itemtap event? I believe your approach is nice, maybe there could be a 'fasttap' or 'quicktap', 'brieftap' -- something like this -- that implements this approach of checking if the tap was long or slow.
    Fabrício Murta
    Developer & Support Expert
  6. #6
    I am using a Grid component.

Similar Threads

  1. [CLOSED] how to avoid textfield autopostback?
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 02, 2015, 5:40 PM
  2. [CLOSED] How to avoid page load on every action/Direct event
    By Vamsi in forum 3.x Legacy Premium Help
    Replies: 1
    Last Post: May 14, 2015, 8:21 PM
  3. Avoid Treepanel Postback
    By AshwiniRane in forum 2.x Help
    Replies: 0
    Last Post: Jul 08, 2014, 12:45 PM
  4. Avoid Form's control Submit
    By Dominik in forum 2.x Help
    Replies: 3
    Last Post: Oct 10, 2012, 1:02 PM
  5. Avoid flickering of page
    By ganesh.tony in forum 1.x Help
    Replies: 1
    Last Post: Aug 11, 2011, 11:53 AM

Posting Permissions