<?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: Calcite Value List: getSelectedItems returns old selection in Calcite Design System Questions</title>
    <link>https://community.esri.com/t5/calcite-design-system-questions/calcite-value-list-getselecteditems-returns-old/m-p/1132242#M61</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/326275"&gt;@JoëlHempenius3&lt;/a&gt;, can you put together a GitHub repo or code sandbox that reproduces this issue?&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jan 2022 23:00:34 GMT</pubDate>
    <dc:creator>BenElan</dc:creator>
    <dc:date>2022-01-10T23:00:34Z</dc:date>
    <item>
      <title>Calcite Value List: getSelectedItems returns old selection</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/calcite-value-list-getselecteditems-returns-old/m-p/1129413#M59</link>
      <description>&lt;LI-CODE lang="c"&gt;this.itemListViewEl.nativeElement.getSelectedItems().then((elements: any) =&amp;gt; {
      const iterator1 = elements.values()
      let selectedElement = iterator1.next().value;
      selectedElement.selected = false;
      elements.clear();
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;calcite-value-list #itemListViewNode (calciteListChange)="checkSelected()"&amp;gt;
                &amp;lt;calcite-pick-list-item  *ngFor="let item of qr?.results" [label]="item.title" [value]="item"
                    [description]="item.owner"  selected="false"&amp;gt;
                &amp;lt;/calcite-pick-list-item&amp;gt;
            &amp;lt;/calcite-value-list&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a Angular, JS API and Calcite Design System application. When call getSelectedItems function from the Calcite Value-List, I get multiple selected items back. I didn't enable multiple. This happens after qr ( PortalQueryResult) is updated with a new PortalQueryResult. In that case I will still get the previously selected item from an previous qr result.&lt;/P&gt;&lt;P&gt;Setting the selected property to false (line 4) doesn't work&lt;BR /&gt;Calling clear()&amp;nbsp; (line 5) on elements does work, but feels weird to call it each time qr object is refreshed with a new result to reset the selected items that way.&lt;/P&gt;&lt;P&gt;Any ideas to get only one selected item from the current PortalQueryResult?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 13:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/calcite-value-list-getselecteditems-returns-old/m-p/1129413#M59</guid>
      <dc:creator>JoëlHempenius3</dc:creator>
      <dc:date>2021-12-29T13:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calcite Value List: getSelectedItems returns old selection</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/calcite-value-list-getselecteditems-returns-old/m-p/1132242#M61</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/326275"&gt;@JoëlHempenius3&lt;/a&gt;, can you put together a GitHub repo or code sandbox that reproduces this issue?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 23:00:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/calcite-value-list-getselecteditems-returns-old/m-p/1132242#M61</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2022-01-10T23:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calcite Value List: getSelectedItems returns old selection</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/calcite-value-list-getselecteditems-returns-old/m-p/1137263#M62</link>
      <description>&lt;P&gt;Hi Ben, Thank you for your response. I will try to make a repo with the issue, will post an update here when ready.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 06:37:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/calcite-value-list-getselecteditems-returns-old/m-p/1137263#M62</guid>
      <dc:creator>JoëlHempenius3</dc:creator>
      <dc:date>2022-01-26T06:37:42Z</dc:date>
    </item>
  </channel>
</rss>

