<?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 Widget Expand is not functioning correctly in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/widget-expand-is-not-functioning-correctly/m-p/1018029#M71431</link>
    <description>&lt;P&gt;I have placed 2 widgets (baseMapGallery, LayerList) inside a small map in a rather large popup. To keep it from crowding out the view, I am trying to use an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Expand&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to launch it from a small icon button in the top-right corner of the map view. As you can see, there are 2 maps in this popup; each with its own separate div/view, independent of the main map view in the foreground.&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="expand_bug.PNG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4083i997A643F8A70DEF6/image-size/large?v=v2&amp;amp;px=999" role="button" title="expand_bug.PNG" alt="expand_bug.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Currently, when I try to launch the widgets from the icon button (Expand), it attempts to open in the main map view to the right of the popup. Also, there is nothing showing (no basmaps, no layer list). Here's my current code for the left map panel with the widgets, expand, and a handler:&lt;/P&gt;&lt;PRE&gt; &lt;SPAN class="hljs-comment"&gt;//Left panel map&lt;/SPAN&gt;
    &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; popupDiv1 = &lt;SPAN class="hljs-built_in"&gt;document&lt;/SPAN&gt;.createElement(&lt;SPAN class="hljs-string"&gt;"div"&lt;/SPAN&gt;);
    popupDiv1.classList.add(&lt;SPAN class="hljs-string"&gt;"mapViewLeft"&lt;/SPAN&gt;);
    popupDiv1.style.marginBottom = &lt;SPAN class="hljs-string"&gt;"10px"&lt;/SPAN&gt;;

    &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; popupView1 = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; MapView({
        &lt;SPAN class="hljs-attr"&gt;container&lt;/SPAN&gt;: popupDiv1,
        &lt;SPAN class="hljs-attr"&gt;map&lt;/SPAN&gt;: map_left,
        &lt;SPAN class="hljs-attr"&gt;actions&lt;/SPAN&gt;: [],
        &lt;SPAN class="hljs-comment"&gt;//center: view.center,&lt;/SPAN&gt;
        &lt;SPAN class="hljs-attr"&gt;center&lt;/SPAN&gt;: [lon, lat],
        &lt;SPAN class="hljs-attr"&gt;zoom&lt;/SPAN&gt;: view.zoom,
        &lt;SPAN class="hljs-comment"&gt;//scale:&lt;/SPAN&gt;
        &lt;SPAN class="hljs-comment"&gt;//    view.scale *&lt;/SPAN&gt;
        &lt;SPAN class="hljs-comment"&gt;//    2 *&lt;/SPAN&gt;
        &lt;SPAN class="hljs-comment"&gt;//    Math.max(view.width / 250, view.height / 250),&lt;/SPAN&gt;
        &lt;SPAN class="hljs-attr"&gt;constraints&lt;/SPAN&gt;: {
            &lt;SPAN class="hljs-attr"&gt;rotationEnabled&lt;/SPAN&gt;: &lt;SPAN class="hljs-literal"&gt;false&lt;/SPAN&gt;
        },
        &lt;SPAN class="hljs-attr"&gt;ui&lt;/SPAN&gt;: {
            &lt;SPAN class="hljs-attr"&gt;components&lt;/SPAN&gt;: [&lt;SPAN class="hljs-string"&gt;"zoom"&lt;/SPAN&gt;]
        }
    });

    &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; layerList_left = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; LayerList({
        &lt;SPAN class="hljs-attr"&gt;view&lt;/SPAN&gt;: popupView1,
        &lt;SPAN class="hljs-attr"&gt;listItemCreatedFunction&lt;/SPAN&gt;: &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt; (&lt;SPAN class="hljs-params"&gt;event&lt;/SPAN&gt;) &lt;/SPAN&gt;{
            &lt;SPAN class="hljs-keyword"&gt;const&lt;/SPAN&gt; item = event.item;
            &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (item.layer.type !== &lt;SPAN class="hljs-string"&gt;"group"&lt;/SPAN&gt;) {
                &lt;SPAN class="hljs-comment"&gt;// don't show legend twice&lt;/SPAN&gt;
                item.panel = {
                    &lt;SPAN class="hljs-attr"&gt;content&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"legend"&lt;/SPAN&gt;,
                    &lt;SPAN class="hljs-attr"&gt;open&lt;/SPAN&gt;: &lt;SPAN class="hljs-literal"&gt;false&lt;/SPAN&gt;
                };
            }
        }
    });

    bgExpandLayerList_2 = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; Expand({
        &lt;SPAN class="hljs-attr"&gt;view&lt;/SPAN&gt;: popupView1,
        &lt;SPAN class="hljs-attr"&gt;content&lt;/SPAN&gt;: layerList_left.container,
        &lt;SPAN class="hljs-attr"&gt;expandIconClass&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"esri-icon-layer-list"&lt;/SPAN&gt;
    });

    &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; basemapGallery_2 = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; BasemapGallery({
        &lt;SPAN class="hljs-attr"&gt;view&lt;/SPAN&gt;: popupView1,
        &lt;SPAN class="hljs-attr"&gt;container&lt;/SPAN&gt;: &lt;SPAN class="hljs-built_in"&gt;document&lt;/SPAN&gt;.createElement(&lt;SPAN class="hljs-string"&gt;"div"&lt;/SPAN&gt;)
    });

    bgExpandBaseMapGallery_2 = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; Expand({
        &lt;SPAN class="hljs-attr"&gt;view&lt;/SPAN&gt;: popupView1,
        &lt;SPAN class="hljs-attr"&gt;content&lt;/SPAN&gt;: basemapGallery.container,
        &lt;SPAN class="hljs-attr"&gt;expandIconClass&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"esri-icon-basemap"&lt;/SPAN&gt;
    });

    expandHandle_a = watchUtils.pausable(bgExpandLayerList_2, &lt;SPAN class="hljs-string"&gt;"expanded"&lt;/SPAN&gt;, &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt; (&lt;SPAN class="hljs-params"&gt;newValue, oldValue&lt;/SPAN&gt;) &lt;/SPAN&gt;{
        &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (newValue === &lt;SPAN class="hljs-literal"&gt;true&lt;/SPAN&gt;) {
            expandHandle_a.pause();
            &lt;SPAN class="hljs-built_in"&gt;setTimeout&lt;/SPAN&gt;(&lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt; () &lt;/SPAN&gt;{
                expandHandle_b.resume();
            }, &lt;SPAN class="hljs-number"&gt;100&lt;/SPAN&gt;);
        } &lt;SPAN class="hljs-keyword"&gt;else&lt;/SPAN&gt; {
            expandHandle_a.resume();
        }
        &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (bgExpandLayerList_2.expanded) {
            bgExpandLayerList_2.collapse();
        }
    });

    expandHandle_b = watchUtils.pausable(bgExpandBaseMapGallery_2, &lt;SPAN class="hljs-string"&gt;"expanded"&lt;/SPAN&gt;, &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt; (&lt;SPAN class="hljs-params"&gt;newValue, oldValue&lt;/SPAN&gt;) &lt;/SPAN&gt;{
        &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (newValue === &lt;SPAN class="hljs-literal"&gt;true&lt;/SPAN&gt;) {
            expandHandle_b.pause();
            &lt;SPAN class="hljs-built_in"&gt;setTimeout&lt;/SPAN&gt;(&lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt; () &lt;/SPAN&gt;{
                expandHandle_a.resume();
            }, &lt;SPAN class="hljs-number"&gt;100&lt;/SPAN&gt;);
        } &lt;SPAN class="hljs-keyword"&gt;else&lt;/SPAN&gt; {
            expandHandle_b.resume();
        }
        &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (bgExpandBaseMapGallery_2.expanded) {
            bgExpandBaseMapGallery_2.collapse();
        }
    });

    popupView1.ui.add(bgExpandLayerList_2, &lt;SPAN class="hljs-string"&gt;"top-right"&lt;/SPAN&gt;);
    popupView1.ui.add(bgExpandBaseMapGallery_2, &lt;SPAN class="hljs-string"&gt;"top-right"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;I've tried removing the handler and just adding a single widget, but I am still seeing the same problem (opening in the wrong view). Any ideas as to what I am doing incorrectly here? The widget works fine by itself (see right panel map), just not with the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Expand. Note: I have a baseMapGallery and LayerList widget in the main view as well that are both working. I have named the variable differently for each. Is there a restriction on adding more than one of the same widget Expand in a web app?&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jan 2021 18:23:55 GMT</pubDate>
    <dc:creator>JustinBridwell2</dc:creator>
    <dc:date>2021-01-19T18:23:55Z</dc:date>
    <item>
      <title>Widget Expand is not functioning correctly</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/widget-expand-is-not-functioning-correctly/m-p/1018029#M71431</link>
      <description>&lt;P&gt;I have placed 2 widgets (baseMapGallery, LayerList) inside a small map in a rather large popup. To keep it from crowding out the view, I am trying to use an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Expand&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to launch it from a small icon button in the top-right corner of the map view. As you can see, there are 2 maps in this popup; each with its own separate div/view, independent of the main map view in the foreground.&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="expand_bug.PNG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4083i997A643F8A70DEF6/image-size/large?v=v2&amp;amp;px=999" role="button" title="expand_bug.PNG" alt="expand_bug.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Currently, when I try to launch the widgets from the icon button (Expand), it attempts to open in the main map view to the right of the popup. Also, there is nothing showing (no basmaps, no layer list). Here's my current code for the left map panel with the widgets, expand, and a handler:&lt;/P&gt;&lt;PRE&gt; &lt;SPAN class="hljs-comment"&gt;//Left panel map&lt;/SPAN&gt;
    &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; popupDiv1 = &lt;SPAN class="hljs-built_in"&gt;document&lt;/SPAN&gt;.createElement(&lt;SPAN class="hljs-string"&gt;"div"&lt;/SPAN&gt;);
    popupDiv1.classList.add(&lt;SPAN class="hljs-string"&gt;"mapViewLeft"&lt;/SPAN&gt;);
    popupDiv1.style.marginBottom = &lt;SPAN class="hljs-string"&gt;"10px"&lt;/SPAN&gt;;

    &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; popupView1 = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; MapView({
        &lt;SPAN class="hljs-attr"&gt;container&lt;/SPAN&gt;: popupDiv1,
        &lt;SPAN class="hljs-attr"&gt;map&lt;/SPAN&gt;: map_left,
        &lt;SPAN class="hljs-attr"&gt;actions&lt;/SPAN&gt;: [],
        &lt;SPAN class="hljs-comment"&gt;//center: view.center,&lt;/SPAN&gt;
        &lt;SPAN class="hljs-attr"&gt;center&lt;/SPAN&gt;: [lon, lat],
        &lt;SPAN class="hljs-attr"&gt;zoom&lt;/SPAN&gt;: view.zoom,
        &lt;SPAN class="hljs-comment"&gt;//scale:&lt;/SPAN&gt;
        &lt;SPAN class="hljs-comment"&gt;//    view.scale *&lt;/SPAN&gt;
        &lt;SPAN class="hljs-comment"&gt;//    2 *&lt;/SPAN&gt;
        &lt;SPAN class="hljs-comment"&gt;//    Math.max(view.width / 250, view.height / 250),&lt;/SPAN&gt;
        &lt;SPAN class="hljs-attr"&gt;constraints&lt;/SPAN&gt;: {
            &lt;SPAN class="hljs-attr"&gt;rotationEnabled&lt;/SPAN&gt;: &lt;SPAN class="hljs-literal"&gt;false&lt;/SPAN&gt;
        },
        &lt;SPAN class="hljs-attr"&gt;ui&lt;/SPAN&gt;: {
            &lt;SPAN class="hljs-attr"&gt;components&lt;/SPAN&gt;: [&lt;SPAN class="hljs-string"&gt;"zoom"&lt;/SPAN&gt;]
        }
    });

    &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; layerList_left = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; LayerList({
        &lt;SPAN class="hljs-attr"&gt;view&lt;/SPAN&gt;: popupView1,
        &lt;SPAN class="hljs-attr"&gt;listItemCreatedFunction&lt;/SPAN&gt;: &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt; (&lt;SPAN class="hljs-params"&gt;event&lt;/SPAN&gt;) &lt;/SPAN&gt;{
            &lt;SPAN class="hljs-keyword"&gt;const&lt;/SPAN&gt; item = event.item;
            &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (item.layer.type !== &lt;SPAN class="hljs-string"&gt;"group"&lt;/SPAN&gt;) {
                &lt;SPAN class="hljs-comment"&gt;// don't show legend twice&lt;/SPAN&gt;
                item.panel = {
                    &lt;SPAN class="hljs-attr"&gt;content&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"legend"&lt;/SPAN&gt;,
                    &lt;SPAN class="hljs-attr"&gt;open&lt;/SPAN&gt;: &lt;SPAN class="hljs-literal"&gt;false&lt;/SPAN&gt;
                };
            }
        }
    });

    bgExpandLayerList_2 = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; Expand({
        &lt;SPAN class="hljs-attr"&gt;view&lt;/SPAN&gt;: popupView1,
        &lt;SPAN class="hljs-attr"&gt;content&lt;/SPAN&gt;: layerList_left.container,
        &lt;SPAN class="hljs-attr"&gt;expandIconClass&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"esri-icon-layer-list"&lt;/SPAN&gt;
    });

    &lt;SPAN class="hljs-keyword"&gt;var&lt;/SPAN&gt; basemapGallery_2 = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; BasemapGallery({
        &lt;SPAN class="hljs-attr"&gt;view&lt;/SPAN&gt;: popupView1,
        &lt;SPAN class="hljs-attr"&gt;container&lt;/SPAN&gt;: &lt;SPAN class="hljs-built_in"&gt;document&lt;/SPAN&gt;.createElement(&lt;SPAN class="hljs-string"&gt;"div"&lt;/SPAN&gt;)
    });

    bgExpandBaseMapGallery_2 = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; Expand({
        &lt;SPAN class="hljs-attr"&gt;view&lt;/SPAN&gt;: popupView1,
        &lt;SPAN class="hljs-attr"&gt;content&lt;/SPAN&gt;: basemapGallery.container,
        &lt;SPAN class="hljs-attr"&gt;expandIconClass&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"esri-icon-basemap"&lt;/SPAN&gt;
    });

    expandHandle_a = watchUtils.pausable(bgExpandLayerList_2, &lt;SPAN class="hljs-string"&gt;"expanded"&lt;/SPAN&gt;, &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt; (&lt;SPAN class="hljs-params"&gt;newValue, oldValue&lt;/SPAN&gt;) &lt;/SPAN&gt;{
        &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (newValue === &lt;SPAN class="hljs-literal"&gt;true&lt;/SPAN&gt;) {
            expandHandle_a.pause();
            &lt;SPAN class="hljs-built_in"&gt;setTimeout&lt;/SPAN&gt;(&lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt; () &lt;/SPAN&gt;{
                expandHandle_b.resume();
            }, &lt;SPAN class="hljs-number"&gt;100&lt;/SPAN&gt;);
        } &lt;SPAN class="hljs-keyword"&gt;else&lt;/SPAN&gt; {
            expandHandle_a.resume();
        }
        &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (bgExpandLayerList_2.expanded) {
            bgExpandLayerList_2.collapse();
        }
    });

    expandHandle_b = watchUtils.pausable(bgExpandBaseMapGallery_2, &lt;SPAN class="hljs-string"&gt;"expanded"&lt;/SPAN&gt;, &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt; (&lt;SPAN class="hljs-params"&gt;newValue, oldValue&lt;/SPAN&gt;) &lt;/SPAN&gt;{
        &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (newValue === &lt;SPAN class="hljs-literal"&gt;true&lt;/SPAN&gt;) {
            expandHandle_b.pause();
            &lt;SPAN class="hljs-built_in"&gt;setTimeout&lt;/SPAN&gt;(&lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;function&lt;/SPAN&gt; () &lt;/SPAN&gt;{
                expandHandle_a.resume();
            }, &lt;SPAN class="hljs-number"&gt;100&lt;/SPAN&gt;);
        } &lt;SPAN class="hljs-keyword"&gt;else&lt;/SPAN&gt; {
            expandHandle_b.resume();
        }
        &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (bgExpandBaseMapGallery_2.expanded) {
            bgExpandBaseMapGallery_2.collapse();
        }
    });

    popupView1.ui.add(bgExpandLayerList_2, &lt;SPAN class="hljs-string"&gt;"top-right"&lt;/SPAN&gt;);
    popupView1.ui.add(bgExpandBaseMapGallery_2, &lt;SPAN class="hljs-string"&gt;"top-right"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;I've tried removing the handler and just adding a single widget, but I am still seeing the same problem (opening in the wrong view). Any ideas as to what I am doing incorrectly here? The widget works fine by itself (see right panel map), just not with the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Expand. Note: I have a baseMapGallery and LayerList widget in the main view as well that are both working. I have named the variable differently for each. Is there a restriction on adding more than one of the same widget Expand in a web app?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 18:23:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/widget-expand-is-not-functioning-correctly/m-p/1018029#M71431</guid>
      <dc:creator>JustinBridwell2</dc:creator>
      <dc:date>2021-01-19T18:23:55Z</dc:date>
    </item>
  </channel>
</rss>

