<?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: onCalciteSelectChange does not fire (React) in Calcite Design System Questions</title>
    <link>https://community.esri.com/t5/calcite-design-system-questions/oncalciteselectchange-does-not-fire-react/m-p/1595008#M816</link>
    <description>&lt;P&gt;I found a way to overcome this issue, using the useRef hook as explained in the following &lt;A title="documentation" href="https://developers.arcgis.com/calcite-design-system/resources/frameworks/" target="_self"&gt;documentation&lt;/A&gt;&amp;nbsp; (Calcite Components React)&lt;/P&gt;</description>
    <pubDate>Thu, 13 Mar 2025 00:11:14 GMT</pubDate>
    <dc:creator>BaptisteDelaporte</dc:creator>
    <dc:date>2025-03-13T00:11:14Z</dc:date>
    <item>
      <title>onCalciteSelectChange does not fire (React)</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/oncalciteselectchange-does-not-fire-react/m-p/1594948#M815</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I having some trouble using a calcite-select (v3.0.3) in a React app.&lt;/P&gt;&lt;P&gt;When I change a value, the onCalciteSelectChange event does not seem to fire at all. I tried to implement a component as simple as it could be in order to replicate this behavior and troubleshoot it but I cannot find anything that resolves it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In what&amp;nbsp; follows, the first component does not work as expected while changing the value whereas the second one is based on a classic html select to check if my react logic is right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import React, { useState, useEffect, useContext, createContext } from 'react';
import { defineCustomElements } from '@esri/calcite-components/dist/loader';

function SelectCalcite(){

    const [selectedValue, setSelectedValue] = useState('option1');

    const handleSelectChange = (event) =&amp;gt; {
        console.log(event.target.value)
        setSelectedValue(event.target.value);
    };

useEffect(() =&amp;gt; {
        defineCustomElements(window);
    }, []);


    return (
        &amp;lt;div&amp;gt;
          &amp;lt;calcite-select value={selectedValue} onCalciteSelectChange={handleSelectChange}&amp;gt;
            &amp;lt;calcite-option value="option1"&amp;gt;Option 1&amp;lt;/calcite-option&amp;gt;
            &amp;lt;calcite-option value="option2"&amp;gt;Option 2&amp;lt;/calcite-option&amp;gt;
            &amp;lt;calcite-option value="option3"&amp;gt;Option 3&amp;lt;/calcite-option&amp;gt;
          &amp;lt;/calcite-select&amp;gt;
    
          &amp;lt;p&amp;gt;Selected value is : {selectedValue}&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      );
}

function Select(){

    const [selectedValue, setSelectedValue] = useState('option1');

    const handleSelectChange = (event) =&amp;gt; {
        console.log(event.target.value)
        setSelectedValue(event.target.value);
    };

    return (
        &amp;lt;div&amp;gt;
          &amp;lt;select value={selectedValue} onChange={handleSelectChange}&amp;gt;
            &amp;lt;option value="option1"&amp;gt;Option 1&amp;lt;/option&amp;gt;
            &amp;lt;option value="option2"&amp;gt;Option 2&amp;lt;/option&amp;gt;
            &amp;lt;option value="option3"&amp;gt;Option 3&amp;lt;/option&amp;gt;
          &amp;lt;/select&amp;gt;
    
          &amp;lt;p&amp;gt;Selected value is : {selectedValue}&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      );
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also been told that we should use&amp;nbsp; event.target.detail in the newest version of calcite but this might not be what causes this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your feedback,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Baptiste&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 00:06:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/oncalciteselectchange-does-not-fire-react/m-p/1594948#M815</guid>
      <dc:creator>BaptisteDelaporte</dc:creator>
      <dc:date>2025-03-13T00:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: onCalciteSelectChange does not fire (React)</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/oncalciteselectchange-does-not-fire-react/m-p/1595008#M816</link>
      <description>&lt;P&gt;I found a way to overcome this issue, using the useRef hook as explained in the following &lt;A title="documentation" href="https://developers.arcgis.com/calcite-design-system/resources/frameworks/" target="_self"&gt;documentation&lt;/A&gt;&amp;nbsp; (Calcite Components React)&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 00:11:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/oncalciteselectchange-does-not-fire-react/m-p/1595008#M816</guid>
      <dc:creator>BaptisteDelaporte</dc:creator>
      <dc:date>2025-03-13T00:11:14Z</dc:date>
    </item>
  </channel>
</rss>

