<?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: Sketch component events not triggering in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1417114#M84457</link>
    <description>&lt;P&gt;Ok, move the script tag with the load code to after the arcgis-map tag and before end of body tag.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="en" dir="ltr"&amp;gt;
&amp;lt;head&amp;gt;
	&amp;lt;meta charset="utf-8" /&amp;gt;
	&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" /&amp;gt;
	&amp;lt;title&amp;gt;Map components AMD template&amp;lt;/title&amp;gt;
	&amp;lt;link rel="icon" href="data:;base64,=" /&amp;gt;
	&amp;lt;style&amp;gt;
		html,
		body {
			background-color: var(--calcite-ui-foreground-2);
			padding: 0;
			margin: 0;
			width: 100vw;
			height: 100vh;
		}
		.my-button {
			margin: 0;
			position: absolute;
				left: 100px;
			top: 10px;
		}
	&amp;lt;/style&amp;gt;
	&amp;lt;script type="module" src="https://js.arcgis.com/calcite-components/2.6.0/calcite.esm.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;link rel="stylesheet" type="text/css" href="https://js.arcgis.com/calcite-components/2.6.0/calcite.css" /&amp;gt;
	&amp;lt;link rel="stylesheet" href="https://js.arcgis.com/next/esri/themes/dark/main.css" /&amp;gt;
	&amp;lt;script src="https://js.arcgis.com/next/"&amp;gt;&amp;lt;/script&amp;gt;
	&amp;lt;script type="module" src="https://jsdev.arcgis.com/map-components/next/arcgis-map-components.esm.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;arcgis-map id="mapElem" item-id="d5dda743788a4b0688fe48f43ae7beb9"&amp;gt;
	&amp;lt;arcgis-sketch position="top-right"&amp;gt;&amp;lt;/arcgis-sketch&amp;gt;
&amp;lt;/arcgis-map&amp;gt;
&amp;lt;script&amp;gt;
		async function load() {
			const sketch = document.querySelector("arcgis-sketch");
			sketch.addEventListener("arcgisReady", () =&amp;gt; {
				console.log("sketch ready");
			});
			sketch.addEventListener("arcgisCreate", (e) =&amp;gt; {
				console.log("sketch create", e);
			});
			sketch.addEventListener("arcgisUpdate", (e) =&amp;gt; {
				console.log("sketch update", e);
			});
		}
        load();
	&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;You typically want script tags with JS as the last tag in the body so that it loads after contents of the html body load.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2024 16:32:20 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2024-04-30T16:32:20Z</dc:date>
    <item>
      <title>Sketch component events not triggering</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1416694#M84436</link>
      <description>&lt;P&gt;I have a simple standalone app to test out the web components. The components in the app are a map and sketch. The map events for a&lt;SPAN&gt;rcgisViewReadyChange and&amp;nbsp;arcgisViewClick work as expected. However, I cannot get any events from the sketch component to trigger. See the below snippet:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;works&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;document.querySelector('arcgis-map').addEventListener('arcgisViewClick', (event) =&amp;gt; {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;console.log("event", event )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;});&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;does nothing&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;document.querySelector('arcgis-sketch').addEventListener('sketchCreate', (event) =&amp;gt; {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;console.log("sketch create", event);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&amp;lt;arcgis-map item-id="my_map_id"&amp;gt;&lt;BR /&gt;&amp;lt;arcgis-elevation-profile position="bottom-right"&amp;gt;&lt;BR /&gt;&amp;lt;/arcgis-elevation-profile&amp;gt;&lt;BR /&gt;&amp;lt;arcgis-legend position="bottom-left"&amp;gt;&amp;lt;/arcgis-legend&amp;gt;&lt;BR /&gt;&amp;lt;arcgis-sketch position="top-right" creationMode="single"&amp;gt;&lt;BR /&gt;&amp;lt;/arcgis-sketch&amp;gt;&lt;BR /&gt;&amp;lt;/arcgis-map&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Has anyone been successful in adding events to the sketch component?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 19:17:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1416694#M84436</guid>
      <dc:creator>RyanDickinson1</dc:creator>
      <dc:date>2024-04-29T19:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch component events not triggering</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1416815#M84445</link>
      <description>&lt;P&gt;This works in "next", but we made some changes to the event names.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/yLrbBoR?editors=0011" target="_blank"&gt;https://codepen.io/odoe/pen/yLrbBoR?editors=0011&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Event names no longer include the name of the component and they are all prefixed with 'arcgis' in the names.&lt;/P&gt;&lt;P&gt;We'll get that added to the breaking changes here.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/feedback-js-api-next/blob/main/CHANGELOG.md#components-breaking-changes" target="_blank"&gt;https://github.com/Esri/feedback-js-api-next/blob/main/CHANGELOG.md#components-breaking-changes&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 00:20:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1416815#M84445</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2024-04-30T00:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch component events not triggering</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1416985#M84450</link>
      <description>&lt;P&gt;Thank you Rene! I copied your pen and attempted using it in a vanilla single page app. However, the event listeners couldn't register (worked in your pen):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RyanDickinson1_0-1714481627190.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/102553i062AAAC5D01E9CBF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RyanDickinson1_0-1714481627190.png" alt="RyanDickinson1_0-1714481627190.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RyanDickinson1_1-1714481657143.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/102554iF6E95C61EE403B78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RyanDickinson1_1-1714481657143.png" alt="RyanDickinson1_1-1714481657143.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 12:54:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1416985#M84450</guid>
      <dc:creator>RyanDickinson1</dc:creator>
      <dc:date>2024-04-30T12:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch component events not triggering</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1417031#M84455</link>
      <description>&lt;P&gt;That error looks like you don't have an arcgis-sketch element on the page. If you provide a repro per the doc, could tell better.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/troubleshooting/#minimal-reproducible-application" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/troubleshooting/#minimal-reproducible-application&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 14:30:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1417031#M84455</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2024-04-30T14:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch component events not triggering</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1417103#M84456</link>
      <description>&lt;P&gt;I put the code into a &lt;A href="https://codepen.io/rdickins18/pen/oNORYxN" target="_self"&gt;pen&lt;/A&gt; and it functioned as expected. I have the standalone app hosted on a webserver and registered with Enterprise 11.1. Here is the &lt;A href="https://github.com/ryandickinson/esri/blob/main/comp_app_two.html" target="_self"&gt;link&lt;/A&gt; to the standalone in github.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 16:19:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1417103#M84456</guid>
      <dc:creator>RyanDickinson1</dc:creator>
      <dc:date>2024-04-30T16:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch component events not triggering</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1417114#M84457</link>
      <description>&lt;P&gt;Ok, move the script tag with the load code to after the arcgis-map tag and before end of body tag.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="en" dir="ltr"&amp;gt;
&amp;lt;head&amp;gt;
	&amp;lt;meta charset="utf-8" /&amp;gt;
	&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" /&amp;gt;
	&amp;lt;title&amp;gt;Map components AMD template&amp;lt;/title&amp;gt;
	&amp;lt;link rel="icon" href="data:;base64,=" /&amp;gt;
	&amp;lt;style&amp;gt;
		html,
		body {
			background-color: var(--calcite-ui-foreground-2);
			padding: 0;
			margin: 0;
			width: 100vw;
			height: 100vh;
		}
		.my-button {
			margin: 0;
			position: absolute;
				left: 100px;
			top: 10px;
		}
	&amp;lt;/style&amp;gt;
	&amp;lt;script type="module" src="https://js.arcgis.com/calcite-components/2.6.0/calcite.esm.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;link rel="stylesheet" type="text/css" href="https://js.arcgis.com/calcite-components/2.6.0/calcite.css" /&amp;gt;
	&amp;lt;link rel="stylesheet" href="https://js.arcgis.com/next/esri/themes/dark/main.css" /&amp;gt;
	&amp;lt;script src="https://js.arcgis.com/next/"&amp;gt;&amp;lt;/script&amp;gt;
	&amp;lt;script type="module" src="https://jsdev.arcgis.com/map-components/next/arcgis-map-components.esm.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;arcgis-map id="mapElem" item-id="d5dda743788a4b0688fe48f43ae7beb9"&amp;gt;
	&amp;lt;arcgis-sketch position="top-right"&amp;gt;&amp;lt;/arcgis-sketch&amp;gt;
&amp;lt;/arcgis-map&amp;gt;
&amp;lt;script&amp;gt;
		async function load() {
			const sketch = document.querySelector("arcgis-sketch");
			sketch.addEventListener("arcgisReady", () =&amp;gt; {
				console.log("sketch ready");
			});
			sketch.addEventListener("arcgisCreate", (e) =&amp;gt; {
				console.log("sketch create", e);
			});
			sketch.addEventListener("arcgisUpdate", (e) =&amp;gt; {
				console.log("sketch update", e);
			});
		}
        load();
	&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;You typically want script tags with JS as the last tag in the body so that it loads after contents of the html body load.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 16:32:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1417114#M84457</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2024-04-30T16:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch component events not triggering</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1417199#M84460</link>
      <description>&lt;P&gt;Thank you very much Rene! That was it!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 18:36:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-component-events-not-triggering/m-p/1417199#M84460</guid>
      <dc:creator>RyanDickinson1</dc:creator>
      <dc:date>2024-04-30T18:36:13Z</dc:date>
    </item>
  </channel>
</rss>

