# Popup Prematurely Closing

**URL:** <https://forum.inductiveautomation.com/t/popup-prematurely-closing/67695>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [December 15, 2022, 8:10pm UTC](https://forum.inductiveautomation.com/t/popup-prematurely-closing/67695 "2022-12-15T20:10:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [December 15, 2022, 8:10pm UTC](https://forum.inductiveautomation.com/t/popup-prematurely-closing/67695/1 "2022-12-15T20:10:31Z")

</div>

I have a curious problem/issue, This popup:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/2/a2626d13ebeda7e2bc5ddad597ef0365b442af9d.jpeg)

It is being opened by this script running in an expression:

```auto
if({this.props.style.classes} = 'TubeLoadFailed' && {session.custom.IP_Address} = '172.29.184.160',runScript("system.perspective.openPopup('','Tube_Load_Failed_PopUps/411_tube_load_failed')"),'')

```

The IP is so that it displays on the correct touch panel, this project is heavy on the indirection by IP address'.

The popup will seem to randomly close with out having to press the "CLOSE" button on the popup itself. The reason this is an issue because the "CLOSE" button makes false the tag that triggers the props.style.classes 'TubeLoadFailed' from the expression, so when it becomes true again then the popup can "popup".

Any ideas on why it may seem to be randomly closing?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 15, 2022, 8:25pm UTC](https://forum.inductiveautomation.com/t/popup-prematurely-closing/67695/2 "2022-12-15T20:25:47Z")

</div>

Ignition's expressions do not short-circuit. Your runScript is likely running a lot more than you think. Evaluate the conditions within a script, not in the expression.

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [December 15, 2022, 9:45pm UTC](https://forum.inductiveautomation.com/t/popup-prematurely-closing/67695/3 "2022-12-15T21:45:27Z")

</div>

Ive been looking and just not sure. I use the same expression to call another script for a popup in the same manner. The only difference is the tube load popups are in a folder where as the other popups are not.

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [December 19, 2022, 7:21pm UTC](https://forum.inductiveautomation.com/t/popup-prematurely-closing/67695/4 "2022-12-19T19:21:37Z")

</div>

Well, I made the popup happen on a change script of the component ad its working like it should, doesnt close until I want it to.
