I use version 4.28 of ArcGIS Maps SDK for JavaScript. I have a button that activate Draw object for drawing, for example, a polyline. But an user could change its mind after he/she pushed the button, so I added other button that should to interrupt (complete) the drawing action. So I added a code
document.getElementById("btnDrop").onclick = () => {
draw.complete();
}
that should interrupt the drawing action. But it does not work. Here a sample that I did in CodePen:
Sample for drawing polyline and a button for cancelling of drawing
So I need a help.