JqueryMobile faucet and bubbling / spreading

Check out this example in Android 2.x browser .. An example for replicating a script in my application.

http://johnchacko.net/samples/tap.html

It's about listening to "tap" and calling changePage from the listener ...

The second page has multiple input fields, the "tap" event bubbles / propagates to the second page, and the focus is randomly set to the input fields ...

I am reading similar problems and want to know if someone faced the same problem and found a workaround ...

Or should I only use "click"?

+3


source to share


1 answer


It can be eliminated in several ways:



  • On your tap / click event, use these methods before calling changePage:

    e.stopPropagation();
    e.stopImmediatePropagation();
    
          

    or

    $(document).on('tap', '#button', function(){       
        e.stopPropagation();
        e.stopImmediatePropagation();
        // Rest of the code
    });
    
          

  • Initialization disables all input fields on the second page in the showhow event setup function and activates them after about 10ms

+2


source







All Articles