Sketch widget won't deselect graphics with portal basemap

336
4
05-13-2020 08:59 AM
MichaelMacFadden
New Contributor

If a map / view is initialized with a basemap from a portal item (as shown below) and we have the sketch widget rendered, we loose the ability to deselect graphics.  

const basemap = new Basemap({
  portalItem: {
    id: "f81bc478e12c4f1691d0d7ab6361f5a6"
  } 
});

const map = new Map({
  basemap: basemap
});

If you draw a square, for example, it will be come selected for update upon creation.  It will be highlighted with the scale/move/rotate tool.  Clicking off the graphic does not deselect it.  If you draw another graphic you can change the selection between the two, but you can not clear the selection by clicking on the basemap.

On the other hand if the basemap is initialized as a string for a known id such as "streets" it works as expected:

const map = new Map({
  basemap: "streets"
});

I have provided a CodePen which demonstrates the issue:

https://codepen.io/michaelmacfadden/pen/qBOyYLX 

0 Kudos
4 Replies
MichaelMacFadden
New Contributor

I should add that this was observed in Chrome on MacOS. Not sure if that will make a difference.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Michael,

   I tested and this is definitely a bug (I ca get it to deselect if I click off the graphic multiple times in multiple places). You will need to contact esri tech support and file a bug for this.

MichaelMacFadden
New Contributor

Thanks for verifying this bug!  I don't have a support plan with Esri, I was just evaluating the JavaScript API to see if it meets my needs.  Found this issue and wasn't sure how to report it given I don't have support. So I thought I would annotate it here.

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

Thank your for reporting this issue. This issue is not related to portalItem. The issue is related to vector tile basemaps. I have created an issue for this and will let you know once we fix it. 

Thanks again for bringing this issue to our attention,

-Undral