How can I know where in a DragAndDropTarget something was dropped? I can see that there's an
onMoved
but I don't see how/where to get the position from.
a
Alexander Maryanovsky
03/12/2026, 10:32 PM
You're not given the position.
You may want to define several targets if the position matters.
m
martmists
03/13/2026, 12:46 AM
That's unfortunate, I'm trying to make a node editor where you can drag an item from a palette to any position on the canvas, and I can't really figure out how else to do it. I tried using pointer events, but the move and release are always handled by the element itself, even if you're already hovering over the canvas itself, and I couldn't find anything else. Do you have any suggestions?
a
Alexander Maryanovsky
03/13/2026, 8:25 AM
System drag-and-drop is not the right mechanism for that.
Find the bounds (relative to window) of both elements, and use them to calculate the position of the pointer in the target element.