I have a problem with using the Draw class for drawing a rectangle on the map after changing the ArcGIS JS lib version from 4.6 to anything higher.
The second file, "Draw_recangle_notworking_lib_v4.7.html", contains the exact same code except for the ArcGIS JS lib version that is used - there, v4.7 is included. Instead of drawing a rectangle, a line is being drawn. This is true for any lib version higher than 4.6.
Unfortunately, I did not find any official example of how to use the Draw class for drawing a rectangle (instead of a "polygon"). I also only found that from 4.6 to 4.7, there was a breaking change being introduced regarding the Draw class where the graphic property was removed from the "draw-complete" event. However, this property is not explicitly being used in the attached code.
I don't encounter similar problems when using this class for drawing polygons or points.
So, my question is whether in order to use "draw.create('rectangle')", my code has to be adjusted since it is now supposed to work differently. One possibility would be to replace the Draw class with the SketchViewModel class but that would probably require larger effort than maybe adjusting the existing code a bit to make it work as expected again.