# \[Bug-7686\] Self-closing Pop-up locks up modal pop-up and entire screen

**URL:** <https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 7, 2023, 8:09pm UTC](https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738 "2023-06-07T20:09:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mal](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mal](https://forum.inductiveautomation.com/u/mal)\
**Post date:** [June 7, 2023, 8:09pm UTC](https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738/1 "2023-06-07T20:09:38Z")

</div>

We have been trying to implement a user feedback popup that lets the user know when something goes wrong or right (Successful update, Failed to Create, etc) that then fades away after a few seconds. We implemented this using a pop-up with a timer script on startup that closes it after 5 seconds, this works. However, we use pop-ups frequently and found that if this user feedback pop-up is opened, then another modal pop-up is opened, then the user feedback pop-up closes followed by closing the modal pop-up, it greys out the entire screen (see below). If you don't have overlay dismiss turned on it freezes up the entire screen and requires a screen refresh to continue.

A teammate and I tested this and found that this bug occurs in 8.1.27 and 8.1.28, but not in 8.1.24.

Has anyone else run into this issue and have a solution?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/c/fccf9ef6315d918bc34b9cd40ffc979ca9e7b162.png)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 7, 2023, 9:04pm UTC](https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738/2 "2023-06-07T21:04:45Z")

</div>

Are you closing the popup with `system.perspective.closePopup('')`?  
Sounds like a bug if it used to work

---

<div class="post-metadata">

**Author:** ![mal](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mal](https://forum.inductiveautomation.com/u/mal)\
**Post date:** [June 7, 2023, 9:17pm UTC](https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738/3 "2023-06-07T21:17:40Z")

</div>

I close it using system.perspective.closePopup(popupId), popupId being the popup's ID field.

Figured it might be a bug, but didn't want to assume.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 7, 2023, 9:19pm UTC](https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738/4 "2023-06-07T21:19:03Z")

</div>

If you're closing the popup that the script is run in, you can just pass in `''` to close it

---

<div class="post-metadata">

**Author:** ![avaughn](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/avaughn/32/38972_2.png) [@avaughn](https://forum.inductiveautomation.com/u/avaughn)\
**Post date:** [June 7, 2023, 9:38pm UTC](https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738/5 "2023-06-07T21:38:23Z")

</div>

This is a known bug with modal popups. I updated the title to reflect the internal ticket number.

---

<div class="post-metadata">

**Author:** ![mal](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mal](https://forum.inductiveautomation.com/u/mal)\
**Post date:** [June 9, 2023, 12:00am UTC](https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738/6 "2023-06-09T00:00:06Z")

</div>

We tried this and it didn't work if we opened up another pop-up while that script was running.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 9, 2023, 7:53am UTC](https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738/7 "2023-06-09T07:53:27Z")

</div>

This doesn't target the popup it's run from but the latest opened popup, I think.  
I'd rather always use an id to make sure I'm targeting the right thing.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 9, 2023, 7:55am UTC](https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738/8 "2023-06-09T07:55:08Z")

</div>

Well that's a bit silly ☹

---

<div class="post-metadata">

**Author:** ![avaughn](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/avaughn/32/38972_2.png) [@avaughn](https://forum.inductiveautomation.com/u/avaughn)\
**Post date:** [June 9, 2023, 2:24pm UTC](https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738/9 "2023-06-09T14:24:17Z")

</div>

According to the [docs](https://docs.inductiveautomation.com/display/DOC81/system.perspective.closePopup), when given an empty string, the most recently focused popup will be closed. However, there is a bug currently that causes the most recently opened popup to be closed instead.

Passing the popup ID is the best way around this bug at the moment.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 9, 2023, 2:46pm UTC](https://forum.inductiveautomation.com/t/bug-7686-self-closing-pop-up-locks-up-modal-pop-up-and-entire-screen/74738/10 "2023-06-09T14:46:57Z")

</div>

uuids everywhere !

```python
def random_id():
	""" Generate a random id to be used for popups or other things that need to be uniquely identified. """
	return str(uuid.uuid4())

```
