<?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 Selection Tools Not Starting at Cursor in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selection-tools-not-starting-at-cursor/m-p/1405254#M84213</link>
    <description>&lt;P&gt;Hello, we have come across a seemingly novel issue in our Vue 3 app that uses `@arcgis/core`, where for whatever reason both of the selection tools will start at the top left corner of the map, instead of where the cursor is.&lt;/P&gt;&lt;P&gt;Here's a sample of how we use the Sketch widget:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// All of this is inside of the body of
// mapView.value.when() statement
//
// Anything with .value is a Vue 3 ref
// https://vuejs.org/api/reactivity-core.html#ref

const graphicLayer = new GraphicsLayer({
  id: 'our-graphics-layer',
  title: 'Graphics',
  parent: map.value?.basemap
});

const sketch = new Sketch({
  layer: graphicLayer,
  layout: 'horizontal',
  view: mapView.value,
  creationMode: "update",
  defaultCreateOptions: {
    mode: "hybrid",
  },
  snappingOptions: {
    enabled: true,
    featureSources: [{ layer: graphicLayer, enabled: true }]
  }
});

mapView.value.map.add(graphicLayer);

// isBlank is a utility function that just checks if a variables value is
// undefine, null or ''
graphicLayer.when(() =&amp;gt; {
   mapView.value.extent = graphicLayer.fullExtent;
   if (!isBlank(mapView.value?.graphics) &amp;amp;&amp;amp; mapView.value?.graphics?.length &amp;gt; 0) {
     graphicLayer.graphics.addMany(mapView.value?.graphics);
   }
});

mapView.value.ui.add(sketch, "bottom-left");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We've tried with on `@arcgis/core` version `4.29.7` and `4.29.10`.&lt;/P&gt;&lt;P&gt;As of note, we can draw points, lines, rectangles, circles and polygons just fine, as well as move them around just fine.&lt;/P&gt;&lt;P&gt;The only issue is that the selection tools will start a selection in the top-left most corner of the map, and not at the cursors position.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIT: &lt;/STRONG&gt;As a note, this is happening on recent versions of both Firefox and Chrome.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 18:18:13 GMT</pubDate>
    <dc:creator>DavidDrennan</dc:creator>
    <dc:date>2024-04-03T18:18:13Z</dc:date>
    <item>
      <title>Selection Tools Not Starting at Cursor</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selection-tools-not-starting-at-cursor/m-p/1405254#M84213</link>
      <description>&lt;P&gt;Hello, we have come across a seemingly novel issue in our Vue 3 app that uses `@arcgis/core`, where for whatever reason both of the selection tools will start at the top left corner of the map, instead of where the cursor is.&lt;/P&gt;&lt;P&gt;Here's a sample of how we use the Sketch widget:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// All of this is inside of the body of
// mapView.value.when() statement
//
// Anything with .value is a Vue 3 ref
// https://vuejs.org/api/reactivity-core.html#ref

const graphicLayer = new GraphicsLayer({
  id: 'our-graphics-layer',
  title: 'Graphics',
  parent: map.value?.basemap
});

const sketch = new Sketch({
  layer: graphicLayer,
  layout: 'horizontal',
  view: mapView.value,
  creationMode: "update",
  defaultCreateOptions: {
    mode: "hybrid",
  },
  snappingOptions: {
    enabled: true,
    featureSources: [{ layer: graphicLayer, enabled: true }]
  }
});

mapView.value.map.add(graphicLayer);

// isBlank is a utility function that just checks if a variables value is
// undefine, null or ''
graphicLayer.when(() =&amp;gt; {
   mapView.value.extent = graphicLayer.fullExtent;
   if (!isBlank(mapView.value?.graphics) &amp;amp;&amp;amp; mapView.value?.graphics?.length &amp;gt; 0) {
     graphicLayer.graphics.addMany(mapView.value?.graphics);
   }
});

mapView.value.ui.add(sketch, "bottom-left");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We've tried with on `@arcgis/core` version `4.29.7` and `4.29.10`.&lt;/P&gt;&lt;P&gt;As of note, we can draw points, lines, rectangles, circles and polygons just fine, as well as move them around just fine.&lt;/P&gt;&lt;P&gt;The only issue is that the selection tools will start a selection in the top-left most corner of the map, and not at the cursors position.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIT: &lt;/STRONG&gt;As a note, this is happening on recent versions of both Firefox and Chrome.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 18:18:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selection-tools-not-starting-at-cursor/m-p/1405254#M84213</guid>
      <dc:creator>DavidDrennan</dc:creator>
      <dc:date>2024-04-03T18:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Tools Not Starting at Cursor</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selection-tools-not-starting-at-cursor/m-p/1405856#M84229</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/614183"&gt;@DavidDrennan&lt;/a&gt; it sounds like this could be a CSS issue. Did it work in previous versions of the API? Try to repro in a codepen using vanillaJS. Otherwise, you'll need to provide a simple, focused StackBlitz or GitHub repo.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 16:16:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selection-tools-not-starting-at-cursor/m-p/1405856#M84229</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2024-04-04T16:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Tools Not Starting at Cursor</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selection-tools-not-starting-at-cursor/m-p/1407122#M84254</link>
      <description>&lt;P&gt;It ended up being CSS, we still had the CSS for an older version of the library loaded. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 14:06:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/selection-tools-not-starting-at-cursor/m-p/1407122#M84254</guid>
      <dc:creator>DavidDrennan</dc:creator>
      <dc:date>2024-04-08T14:06:18Z</dc:date>
    </item>
  </channel>
</rss>

