<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Popup is not displayed correctly when map is absolute positioned on page in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586562#M54793</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;I have trouble understanding your solution Is it possible to have the full code of your _setPosition function?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Nov 2017 20:21:54 GMT</pubDate>
    <dc:creator>SebastienPelletier</dc:creator>
    <dc:date>2017-11-24T20:21:54Z</dc:date>
    <item>
      <title>Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586547#M54778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a map on page that is absolute positioned: &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://dl.dropbox.com/u/2306934/NRK/trafikk/popupbug/popup.html"&gt;http://dl.dropbox.com/u/2306934/NRK/trafikk/popupbug/popup.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#mapcontainer {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; position: absolute;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; top: 400px;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; left: 300px;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem with absolute positioned maps is that the popup placement is not working correctly; the popup is displayed outside the map window:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]13627[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We need to use absolute positioned elements on our site - is it possible to fix this issue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I presume there is a bug in the "_setPosition" function of esri.dijit.Popup:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/esri/dijit/Popup.xd.js"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/esri/dijit/Popup.xd.js&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 12:25:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586547#M54778</guid>
      <dc:creator>BjørnSandvik</dc:creator>
      <dc:date>2012-04-18T12:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586548#M54779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The same problem occurs when the map is not absolute positioned as well: &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://dl.dropbox.com/u/2306934/NRK/trafikk/popupbug/popup3.html"&gt;http://dl.dropbox.com/u/2306934/NRK/trafikk/popupbug/popup3.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On this page, the map is placed below a header div with a height of 400px. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The popup is displaced: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]13664[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any solution to this issue?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2012 07:28:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586548#M54779</guid>
      <dc:creator>BjørnSandvik</dc:creator>
      <dc:date>2012-04-19T07:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586549#M54780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can't view your code at work because dropbox is blocked, but I can tell by your zoom bar that you don't have &amp;lt;body class="claro"&amp;gt; set. Try adding the class and see if that fixes it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2012 12:30:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586549#M54780</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2012-04-19T12:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586550#M54781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've added the class to the body tag, but it didn't fix the issue. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The HTML-file is available in the attached file (popup.zip).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bjorn&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2012 16:12:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586550#M54781</guid>
      <dc:creator>BjørnSandvik</dc:creator>
      <dc:date>2012-04-19T16:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586551#M54782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Anyone from ESRI who knows how to fix this issue? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to get an unminified version of the esri.dijit.Popup JavaScript code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/esri/dijit/Popup.xd.js"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/esri/dijit/Popup.xd.js&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 07:57:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586551#M54782</guid>
      <dc:creator>BjørnSandvik</dc:creator>
      <dc:date>2012-04-20T07:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586552#M54783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I brought the source code in to Visual Web Developer and I removed the header (Which placed the map in the upper left corner) and clicked on a spot near the top of the map div and the response placed the popup below the spot I clicked, within the map.&amp;nbsp; I then re-added the header div and clicked on the same point and the popup appears above the point, off the map area.&amp;nbsp; I only add this as a confirmation of the observed results.&amp;nbsp; I don't know if it is intentional or a bug, hopefully one of the ESRI heroes are taking a look in to it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I find out anything I will post back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best wishes,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 16:28:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586552#M54783</guid>
      <dc:creator>PaulBushore</dc:creator>
      <dc:date>2012-04-20T16:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586553#M54784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have found this workaround. Please test and see if it works for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Replace your : dojo.connect(map,"onClick",function(evt)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;with the code given below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dojo.connect(map,"onClick",function(evt){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new esri.tasks.Query();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.geometry = pointToExtent(map,evt.mapPoint,10);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var deferred = featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.setFeatures([deferred]);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.show(evt.mapPoint);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.resize(200,100);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.centerAt(evt.mapPoint);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure thought if this was your problem! But there is no harm in trying:)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:13:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586553#M54784</guid>
      <dc:creator>ShreyasVakil</dc:creator>
      <dc:date>2021-12-12T01:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586554#M54785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Shreyas,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, it is a workaround to recenter the map on each click - but we would like to have the default behavior where the popup is placed according to the map window. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any chance you'll fix this bug? This seems to work correctly with the standard InfoWindow, the problem occurs in esri.dijit.Popup.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bjorn&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 10:30:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586554#M54785</guid>
      <dc:creator>BjørnSandvik</dc:creator>
      <dc:date>2012-04-23T10:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586555#M54786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Shreyas,&lt;BR /&gt;&lt;BR /&gt;Yes, it is a workaround to recenter the map on each click - but we would like to have the default behavior where the popup is placed according to the map window. &lt;BR /&gt;&lt;BR /&gt;Any chance you'll fix this bug? This seems to work correctly with the standard InfoWindow, the problem occurs in esri.dijit.Popup.&lt;BR /&gt;&lt;BR /&gt;Bjorn&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Bjorn,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to reproduce the abnormal behavior of popup, I'll dig in some resources and come back to you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Shreyas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 21:47:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586555#M54786</guid>
      <dc:creator>ShreyasVakil</dc:creator>
      <dc:date>2012-04-23T21:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586556#M54787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Bjørn,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A bug has been logged for this issue (NIM080359). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shreyas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2012 22:49:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586556#M54787</guid>
      <dc:creator>ShreyasVakil</dc:creator>
      <dc:date>2012-04-24T22:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586557#M54788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you know when this bug will be fixed? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a critical feature for our application. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bjorn&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 09:59:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586557#M54788</guid>
      <dc:creator>BjørnSandvik</dc:creator>
      <dc:date>2012-05-07T09:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586558#M54789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Our developers are still working on this bug. I can only update you as soon as I have any update on this. I apologize for inconvenience caused to you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shreyas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 22:01:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586558#M54789</guid>
      <dc:creator>ShreyasVakil</dc:creator>
      <dc:date>2012-05-08T22:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586559#M54790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;NIM080359 was not acknowledged as a valid bug by our development team. They explained that a dijit.layout.BorderContainer or a dijit.layout.ContentPane can be used to position the map with absolute values and provided the &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/jagravois/zdsj9/"&gt;following&lt;/A&gt;&lt;SPAN&gt; application as an example of a viable approach to resolve the error.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 15:29:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586559#M54790</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2013-03-21T15:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586560#M54791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For what it's worth, the API's positioning logic for the Popup dijit is still not working satisfactorily for us in version 3.8.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After some code digging, we determined that the issue for us is when the popup's content is large enough that there's no selection of anchor point for the popup that avoids the popup overflowing outside the map's boundaries. In this case, instead of making a best effort choice of anchor point, minimizing overflow, the API simply keeps the existing anchor point for the popup.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It should be noted that the content's size is calculated from the dimensions of the Popup._positioner dom element, which appears to be the size of the largest content ever displayed in the popup. So if you're not currently displaying a large popup, you may still have the issue because you previously showed content that caused the _positioner to expand in size.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Our solution was to override the Popup._setPosition function and add logic for the case when no anchor point avoids overflow. Here's what our added logic looks like (in the final else):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if (roomToTheRight &amp;amp;&amp;amp; roomAbove) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; horAnchor = "Left"; verAnchor = "bottom";
}
else if (roomToTheRight &amp;amp;&amp;amp; roomBelow) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; horAnchor = "Left"; verAnchor = "top";
}
else if (roomToTheLeft &amp;amp;&amp;amp; roomBelow) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; horAnchor = "Right"; verAnchor = "top";
}
else if (roomToTheLeft &amp;amp;&amp;amp; roomAbove) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; horAnchor = "Right"; verAnchor = "bottom";
}
else {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // No room in any direcion, choose anchor that gives most room
&amp;nbsp;&amp;nbsp;&amp;nbsp; var horCoverages = [];
&amp;nbsp;&amp;nbsp;&amp;nbsp; horCoverages.push({ "anchor": "", "overflow": Math.max(0, (contentBox.w / 2) - (absoluteX - left)) + Math.max(0, (contentBox.w / 2) - (right - absoluteX + 1)) });
&amp;nbsp;&amp;nbsp;&amp;nbsp; horCoverages.push({ "anchor": "Right", "overflow": Math.max(0, contentBox.w - (absoluteX - left)) });
&amp;nbsp;&amp;nbsp;&amp;nbsp; horCoverages.push({ "anchor": "Left", "overflow": Math.max(0, contentBox.w - (right - absoluteX + 1)) });
&amp;nbsp;&amp;nbsp;&amp;nbsp; var verCoverages = [];
&amp;nbsp;&amp;nbsp;&amp;nbsp; verCoverages.push({ "anchor": "", "overflow": Math.max(0, (heightNeeded / 2) - (absoluteY - top)) + Math.max(0, (heightNeeded / 2) - (bottom - absoluteY + 1)) });
&amp;nbsp;&amp;nbsp;&amp;nbsp; verCoverages.push({ "anchor": "bottom", "overflow": Math.max(0, heightNeeded - (absoluteY - top)) });
&amp;nbsp;&amp;nbsp;&amp;nbsp; verCoverages.push({ "anchor": "top", "overflow": Math.max(0, heightNeeded - (bottom - absoluteY + 1)) });
&amp;nbsp;&amp;nbsp;&amp;nbsp; var sortFunction = function (a, b) { return a.overflow &amp;gt; b.overflow; };
&amp;nbsp;&amp;nbsp;&amp;nbsp; horCoverages.sort(sortFunction);
&amp;nbsp;&amp;nbsp;&amp;nbsp; verCoverages.sort(sortFunction);
&amp;nbsp;&amp;nbsp;&amp;nbsp; horAnchor = horCoverages[0].anchor;
&amp;nbsp;&amp;nbsp;&amp;nbsp; verAnchor = verCoverages[0].anchor;
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("There's no room for the popup, chose most optimal anchoring " + verAnchor + horAnchor + "...");
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:13:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586560#M54791</guid>
      <dc:creator>OttarViken_Valvåg</dc:creator>
      <dc:date>2021-12-12T01:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586561#M54792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN lang="en"&gt;After 5 years now, this problem is still present &lt;/SPAN&gt;&lt;SPAN lang="en"&gt;
&lt;/SPAN&gt;&lt;SPAN lang="en"&gt;and your workaround does not work with the version 3.22&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:13:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586561#M54792</guid>
      <dc:creator>SebastienPelletier</dc:creator>
      <dc:date>2021-12-12T01:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Popup is not displayed correctly when map is absolute positioned on page</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586562#M54793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;I have trouble understanding your solution Is it possible to have the full code of your _setPosition function?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2017 20:21:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-is-not-displayed-correctly-when-map-is/m-p/586562#M54793</guid>
      <dc:creator>SebastienPelletier</dc:creator>
      <dc:date>2017-11-24T20:21:54Z</dc:date>
    </item>
  </channel>
</rss>

