jQuery.mobile popup immediately hides after showing

android, backbone.js, cordova, jquery-mobile

Solution

I spent hours trying to fix this problem.

Finally I ended up doing the following two things that seemed to fix the problem.

this code snippet may help you ->

$('#testBtn').on('tap',function(e){
   console.log("button clicked");
   e.preventDefault();
   $('#testPOPUP').popup("open");
});

Please note i have used `e.perventDefault().`

Problem

I have a small phonegap application with jquery mobile and backbone. I'm trying to show popup to user by manually calling .popup() method. Everything works fine on iOS but on android I got strange issue: popup is showing for few moments and than disappear. Here the actual code: ``` var PostView = Backbone.View.extend({ events: { 'touchend .add-comment-button': 'addComment' }, addComment: function() { this.$(".comment-popup").popup('open', { history: false }); return false; // Stop bubbling. } }); ``` I'm using history: false because this popup is actualy part of subpage. The code looks very simple, I'm just can't understand why it can disappear, and why this happen only on android devices. Thanks, and sorry for my bad english.

Original source

Related problems