Web Drag and Drop : MouseDown or MouseMove code stops AllowTextDrag and AllowPictureDrag

Xojo: Xojo 2015r3

Steps: In order to position a picture onto a web canvas, it is necessary to know where it has been clicked before dragging. I thought that was simple : use MouseDown to know that. Unfortunately, as soon as code is entered in MouseDown or MouseMove the control loses the AllowTextDrag or AllowPictureDrag. Stops dragging.

I think it is a bug.

Attached is a modified DragTest example where I added MouseDown to Rectangle1 with simply
System.DebugLog Str(X)
It stopped being draggable.

Expected Result:
Control drags

Actual Result:
Control won’t drag

Workarounds:
Use JavaScript onMouseDown

feedback://showreport?report_id=41317

This is not a bug. The entire drag action must be done in a single synchronous “event”. And before anyone jumps on this… Yes, there are 8 or so events being fired throughout the drag process, but sending the event to the server and getting a response back likely won’t happen quickly enough.

You should, however, file a feature request to get the origin x & y coordinates as part of the WebDragItem.

Done :slight_smile:
feedback://showreport?report_id=41323

Thank you.

Would be pretty cool to get this soon. As said in origin discussion drag and drop with images isn’t useful when the preview image does not represent the drop position as a user would expect…

You may also want to check https://forum.xojo.com/947-we-drag-and-drop-files-into-webpage/0