facebook

Debounce issue

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #342800 Reply

    Ben Shoan
    Member

    Hi,

    I noticed that button presses sometime executed twice.
    Not sure if related to my code.
    I managed to solve the problem with this code.
    Should I keep this on all my app?

    var DebounceFlag = false;
    var DebounceTimer;

    function Debounce ()
    {
    if(DebounceFlag == false)
    {
    DebounceFlag = true;
    DebounceTimer = setTimeout(function(){DebounceFlag = false}, 300);
    }
    else
    {
    clearTimeout(DebounceTimer);
    DebounceFlag = false;
    }
    }

    function BtnPress()
    {
    Debounce();
    if(DebounceFlag == true)
    {
    do something;
    }
    }

    #342802

    support-michael
    Keymaster

    Hi Ben,

    Thanks for sharing this issue. There is a new implementation for event handling for clickable widgets in the upcoming version, 2.5 milestone-3 in approximately 2 weeks that takes care of this issue.

    #342803

    Hi guys, I am having the same issues with my button functions executed twice. Good to hear you are on to it Wayne, hopefully milestone 3 will save the day for me, regards Dave.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Debounce issue

You must be logged in to post in the forum log in