<?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: 4.19 UniqueValueRenderer.removeUniqueValueInfo Bug in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1350413#M82792</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/169842"&gt;@Noah-Sager&lt;/a&gt;, I have found it to be fixed in 4.28.&amp;nbsp; If you'd like a couple easy kills for the next release, these two are still open:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labeling-bug-with-rangedomain-4-26-and-previous/td-p/1280469" target="_self"&gt;Labeling bug with RangeDomain (4.26 and previous)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-selectedfeature-when-browsing-cluster-s/m-p/1298606" target="_self"&gt;Using selectedFeature when browsing cluster's features from popup&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Despite the name of that first one involving 4.26, it applies to 4.27 and 4.28 too.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2023 19:06:22 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2023-11-16T19:06:22Z</dc:date>
    <item>
      <title>4.19 UniqueValueRenderer.removeUniqueValueInfo Bug</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1074484#M73708</link>
      <description>&lt;P&gt;The &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-UniqueValueInfo.html#value" target="_self"&gt;value&lt;/A&gt; property of a&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-UniqueValueInfo.html" target="_self"&gt;UniqueValueInfo&lt;/A&gt; instance can be either a String or a Number, as documented.&amp;nbsp; Therefore, the documentation also indicates that the&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#removeUniqueValueInfo" target="_self"&gt;removeUniqueValueInfo&lt;/A&gt; method of the&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html" target="_self"&gt;UniqueValueRenderer&lt;/A&gt; class accepts either a String or a Number.&amp;nbsp; However, this method will &lt;STRONG&gt;not&lt;/STRONG&gt; remove UniqueValueInfo instances if their value property has a numeric value, regardless of whether you pass a String or a Number to the function.&lt;/P&gt;&lt;P&gt;The reason for this can be seen inside the definition of the&amp;nbsp;removeUniqueValueInfo function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;for (let b = 0; b &amp;lt; this.uniqueValueInfos.length; b++)
    if (this.uniqueValueInfos[b].value === a + "") {
        delete this._valueInfoMap[a];
        this.uniqueValueInfos.splice(b, 1);
        break
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the "if" statement of line 2 above, the variable "a" contains the value passed into the function.&amp;nbsp; In this same line, if the left-hand side of the comparison is a Number, then&amp;nbsp;the result will &lt;STRONG&gt;always&lt;/STRONG&gt; be false, because the identity/strictly equals operator (===) is used, and the right-hand side will &lt;STRONG&gt;always&lt;/STRONG&gt; be a String.&lt;/P&gt;&lt;P&gt;My fix for 4.19 is to make the following change in the init.js file (assuming a locally hosted API):&lt;/P&gt;&lt;P&gt;Search For:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if(this.uniqueValueInfos[N].value===S+"")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replace With:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if(this.uniqueValueInfos[N].value+""===S+"")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note, I've verified the same problem goes back at least as far as 4.16, but this fix is specific to 4.19.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 21:34:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1074484#M73708</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2021-06-30T21:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: 4.19 UniqueValueRenderer.removeUniqueValueInfo Bug</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1164421#M77017</link>
      <description>&lt;P&gt;Thanks for reporting this&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;. I can reproduce the issue. We'll investigate.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 14:57:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1164421#M77017</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-04-14T14:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: 4.19 UniqueValueRenderer.removeUniqueValueInfo Bug</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1234747#M79440</link>
      <description>&lt;P&gt;The definition of&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#removeUniqueValueInfo" target="_self"&gt;removeUniqueValueInfo&lt;/A&gt; was modified in 4.25, but this bug continues to exist...&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 21:44:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1234747#M79440</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2022-11-23T21:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: 4.19 UniqueValueRenderer.removeUniqueValueInfo Bug</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1337318#M82454</link>
      <description>&lt;P&gt;Thanks for your patience with this issue &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;. I can confirm that this will be fixed at version 4.28, which is due out in a few weeks.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 15:28:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1337318#M82454</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2023-10-12T15:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: 4.19 UniqueValueRenderer.removeUniqueValueInfo Bug</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1350413#M82792</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/169842"&gt;@Noah-Sager&lt;/a&gt;, I have found it to be fixed in 4.28.&amp;nbsp; If you'd like a couple easy kills for the next release, these two are still open:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labeling-bug-with-rangedomain-4-26-and-previous/td-p/1280469" target="_self"&gt;Labeling bug with RangeDomain (4.26 and previous)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-selectedfeature-when-browsing-cluster-s/m-p/1298606" target="_self"&gt;Using selectedFeature when browsing cluster's features from popup&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Despite the name of that first one involving 4.26, it applies to 4.27 and 4.28 too.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 19:06:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-19-uniquevaluerenderer-removeuniquevalueinfo-bug/m-p/1350413#M82792</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-11-16T19:06:22Z</dc:date>
    </item>
  </channel>
</rss>

