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.
<SPAN class="keyword token">const</SPAN> basemap <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Basemap</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>
portalItem<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"f81bc478e12c4f1691d0d7ab6361f5a6"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">const</SPAN> map <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Map</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>
basemap<SPAN class="punctuation token">:</SPAN> basemap
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>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