# Force to open popup only inside the browser area

**URL:** <https://forum.inductiveautomation.com/t/force-to-open-popup-only-inside-the-browser-area/41887>\
**Category:** Ignition Early Access\
**Created:** [January 1, 2021, 4:48am UTC](https://forum.inductiveautomation.com/t/force-to-open-popup-only-inside-the-browser-area/41887 "2021-01-01T04:48:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [January 1, 2021, 4:48am UTC](https://forum.inductiveautomation.com/t/force-to-open-popup-only-inside-the-browser-area/41887/1 "2021-01-01T04:48:59Z")

</div>

Hello  
When using related open popup with relative position(relative to click position), if the click position in near to the browser edge the popup is shown out of the browser border as shown is image below.  
Is there any way to force it open browser?  
Writing script to detect this situation is hard because there is no way to know width and height of the client browser in perspective.  
Unlike the desktop visualization like vision the perspective popup can’t move outside of the browser area so it is nice to have this feature already implement in perspective.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/d/9d5d623841f93245c2b2f41f80ddd047f2801301.png)

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [January 4, 2021, 9:51pm UTC](https://forum.inductiveautomation.com/t/force-to-open-popup-only-inside-the-browser-area/41887/2 "2021-01-04T21:51:51Z")

</div>

Hi Nader.

We have something in the works already to help prevent popups from going beyond the dimensions of the visual viewport. This should help solve your problem.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [January 5, 2021, 3:33am UTC](https://forum.inductiveautomation.com/t/force-to-open-popup-only-inside-the-browser-area/41887/3 "2021-01-05T03:33:30Z")

</div>

Hi Yousef  
That’s great news.  
Is it going to release in 8.1.2?

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [January 5, 2021, 9:04am UTC](https://forum.inductiveautomation.com/t/force-to-open-popup-only-inside-the-browser-area/41887/4 "2021-01-05T09:04:03Z")

</div>

Something else that may help in the meanwhile, is if you open the popup via scripting instead of an action, you can provide vw and vh sizing to help keep things in window. Unfortunately can’t do that with the built in “popup action” though, just numbers there

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [January 5, 2021, 10:17am UTC](https://forum.inductiveautomation.com/t/force-to-open-popup-only-inside-the-browser-area/41887/5 "2021-01-05T10:17:41Z")

</div>

But for this I need to know my target device resolution so if height of my popup plus the mouse y position is higher than height of display I put new y position

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [January 5, 2021, 3:18pm UTC](https://forum.inductiveautomation.com/t/force-to-open-popup-only-inside-the-browser-area/41887/6 "2021-01-05T15:18:57Z")

</div>

So, what you’re trying to create is a popup/modal similar to what we use for the alarm tables (in most recent release). Where the popup/modal positions itself intelligently based upon its dimensions and the available space? Something like this?

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

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [January 5, 2021, 3:53pm UTC](https://forum.inductiveautomation.com/t/force-to-open-popup-only-inside-the-browser-area/41887/7 "2021-01-05T15:53:38Z")

</div>

Sure. Exactly  
Popup beingsmart and calculate the position by perspective is the best.  
Only activate this option when some area of popup is out side of the browser space.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [January 29, 2021, 7:35pm UTC](https://forum.inductiveautomation.com/t/force-to-open-popup-only-inside-the-browser-area/41887/8 "2021-01-29T19:35:48Z")

</div>

Please see this post: [[Bug-13304]Dragging popup prevents text area input on tablet](http://forum.inductiveautomation.com/t/bug-13304-dragging-popup-prevents-text-area-input-on-tablet/23569/10)
