<?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: Auto close widget when another widget is opened (JS 4.x) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/auto-close-widget-when-another-widget-is-opened-js/m-p/1243064#M79699</link>
    <description>&lt;P&gt;The Expand widget has a group property that will handle this for you.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#group" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#group&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Dec 2022 20:00:29 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2022-12-21T20:00:29Z</dc:date>
    <item>
      <title>Auto close widget when another widget is opened (JS 4.x)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/auto-close-widget-when-another-widget-is-opened-js/m-p/1242996#M79698</link>
      <description>&lt;P&gt;I am looking for a way to add some script to my current application that will make widgets close when another widget is opened. The issue I am trying to avoid is having multiple widgets overlapping each other like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="moremeowbell_0-1671643422449.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/59030i7136E2C40BE925F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="moremeowbell_0-1671643422449.png" alt="moremeowbell_0-1671643422449.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found this post that has a solution, but it's using the JS 3.x library.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-close-a-widget-when-opening-another/td-p/249642" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-close-a-widget-when-opening-another/td-p/249642&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATE:&lt;/P&gt;&lt;P&gt;I have created this code. With only one reactiveUtils it works, but when I add in all of the reactiveUtils it does work. Any suggestions?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    // configure auto close for widgets
    function closeWidget(esriWidget){
      esriWidget.expanded = false
    }

    reactiveUtils.when(
      () =&amp;gt; measureExpand.expanded,
      () =&amp;gt; {
        closeWidget(eyeExpand)
        closeWidget(legendExpand)
        closeWidget(btnExpand)
      });

    reactiveUtils.when(
      () =&amp;gt; eyeExpand.expanded,
      () =&amp;gt; {
        closeWidget(measureExpand)
        closeWidget(legendExpand)
        closeWidget(btnExpand)
      });

    reactiveUtils.when(
      () =&amp;gt; btnExpand.expanded,
      () =&amp;gt; {
        closeWidget(measureExpand)
        closeWidget(legendExpand)
        closeWidget(eyeExpand)
      });

    reactiveUtils.when(
      () =&amp;gt; legendExpand.expanded,
      () =&amp;gt; {
        closeWidget(eyeExpand)
        closeWidget(measureExpand)
        closeWidget(btnExpand)
      });&lt;/LI-CODE&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 19:39:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/auto-close-widget-when-another-widget-is-opened-js/m-p/1242996#M79698</guid>
      <dc:creator>moremeowbell</dc:creator>
      <dc:date>2022-12-21T19:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Auto close widget when another widget is opened (JS 4.x)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/auto-close-widget-when-another-widget-is-opened-js/m-p/1243064#M79699</link>
      <description>&lt;P&gt;The Expand widget has a group property that will handle this for you.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#group" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#group&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 20:00:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/auto-close-widget-when-another-widget-is-opened-js/m-p/1243064#M79699</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2022-12-21T20:00:29Z</dc:date>
    </item>
  </channel>
</rss>

