# ionicPopup: Popup is not removed from DOM tree when using PhoneGap

**URL:** <https://forum.ionicframework.com/t/ionicpopup-popup-is-not-removed-from-dom-tree-when-using-phonegap/2239>\
**Category:** ionic-v1\
**Created:** [March 25, 2014, 7:51pm UTC](https://forum.ionicframework.com/t/ionicpopup-popup-is-not-removed-from-dom-tree-when-using-phonegap/2239 "2014-03-25T19:51:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![whomike](https://avatars.discourse-cdn.com/v4/letter/w/77aa72/32.png) [@whomike](https://forum.ionicframework.com/u/whomike)\
**Post date:** [March 25, 2014, 7:51pm UTC](https://forum.ionicframework.com/t/ionicpopup-popup-is-not-removed-from-dom-tree-when-using-phonegap/2239/1 "2014-03-25T19:51:45Z")

</div>

Hi,

I have the following issue: I am using the latest ionic version with ionic popup support in my app. When I test the application in my browser on my computer everything works fine. A popup is shown and when I click a button, the popup is removed. And, (this is important) it is no longer part of the DOM tree.

But, when I build the application using phonegap build, I have a strange behavior: When I click a button in the ionic popup window, the popup is no longer displayed (thats correct), but it is not removed from the DOM tree (as I have seen in phonegap debug mode). Thus, everytime I click on a button, the DOM tree increases and increases. Furthermore, obviously the popup is still present, because: At the position the popup was shown I can no longer click on any button. At the area around the privious popup everything works as usual. But in the area of the popup nothing reacts. Sometimes even the popup flickers and I can see it for a few milliseconds.

Any idea what is going wrong here?

Kind regards,

Mike

---

<div class="post-metadata">

**Author:** ![Piernik](https://avatars.discourse-cdn.com/v4/letter/p/f0a364/32.png) [@Piernik](https://forum.ionicframework.com/u/Piernik)\
**Post date:** [March 25, 2014, 8:03pm UTC](https://forum.ionicframework.com/t/ionicpopup-popup-is-not-removed-from-dom-tree-when-using-phonegap/2239/2 "2014-03-25T20:03:45Z")

</div>

There is a issue concerning that thing:

> <https://github.com/ionic-team/ionic/issues/851>
>
> When I open and close popup on android 4.1 it acts like popup was still in DOM but not visible. In...

Hope they will fix it in beta

---

<div class="post-metadata">

**Author:** ![whomike](https://avatars.discourse-cdn.com/v4/letter/w/77aa72/32.png) [@whomike](https://forum.ionicframework.com/u/whomike)\
**Post date:** [March 25, 2014, 8:14pm UTC](https://forum.ionicframework.com/t/ionicpopup-popup-is-not-removed-from-dom-tree-when-using-phonegap/2239/3 "2014-03-25T20:14:06Z")

</div>

Hi,

ah great, this seems to be the same issue. So, I hope they can fix it until beta.

Thank you!

Mike

---

<div class="post-metadata">

**Author:** ![whomike](https://avatars.discourse-cdn.com/v4/letter/w/77aa72/32.png) [@whomike](https://forum.ionicframework.com/u/whomike)\
**Post date:** [March 29, 2014, 9:41pm UTC](https://forum.ionicframework.com/t/ionicpopup-popup-is-not-removed-from-dom-tree-when-using-phonegap/2239/4 "2014-03-29T21:41:07Z")

</div>

Hm, I have just upgraded my Android phone from Android 4.3 to 4.4.2. Now, I do not have this issue any more.

So obvious, it is something that does depend on the browser or platform version.

Regards,

Mike
