Page 1 of 1

Popup closes and opens again

Posted: Mon Apr 22, 2013 8:47 pm
by Marcelo

I don't know why my popups, which were working ok before today, now are automatically reopening again after I close them. And It repeats this behavior many times - I close it, it reopens instantly. Please, advise.


Popup closes and opens again

Posted: Mon Apr 22, 2013 8:55 pm
by Kateryna Grynko

Hi Marcelo,

Seems there are some problems with events. Please check on what event you call Action "Show Popup".


Popup closes and opens again

Posted: Mon Apr 22, 2013 9:00 pm
by Marcelo

Hi, Katya. I am using javascript:

Appery.navigateTo('dialogPopup', {
transition: 'none'
});

Today I changed from "Tiggzi.navigateTo" to "Appery.navigateTo" as an attempt to fix the issue, but it makes no difference.


Popup closes and opens again

Posted: Mon Apr 22, 2013 9:01 pm
by Marcelo

Additional info. When I hit the button on popup, I am using tap event and closePopup action to close the popup.


Popup closes and opens again

Posted: Mon Apr 22, 2013 9:03 pm
by Kateryna Grynko

On what event do you call the code above?


Popup closes and opens again

Posted: Mon Apr 22, 2013 9:16 pm
by Marcelo

On click event of a button. Humm... should it be tap event? Could it be the reason? I am going to test the tap event right now.


Popup closes and opens again

Posted: Mon Apr 22, 2013 10:04 pm
by Marcelo

I think I understood what is happening. I noticed that as soon as the popup closes, the button that initially loaded the popup catches the same click/tap event that closed the popup, causing the popup to open again. If I carefully touch the button on the popup screen, the effect does not happen. Interesting... now I have to figure it out how to prevent the propagation.


Popup closes and opens again

Posted: Sun Apr 28, 2013 8:46 pm
by Joop Verbaken

Marcelo, we had the same problem. We expect that the '.on('click', '#button' , function() Appery.navigationTo('dialogPopup'. {transition: 'none'}); is defined multiple times.

To solve it we did:
Create a function that defines as a singleton function once the definition of the on_click call back functions and then invokes it once when this functions is created at 'on_load'

Let us know if this fix it for you too.


Popup closes and opens again

Posted: Mon Apr 29, 2013 12:11 pm
by Marcelo

Joop, thank you very much for sharing your solution.
We have fixed it some how (the guy that worked on it is travelling), but I believe it had something to do with your point.