Closed fredericrous closed 9 months ago
When I drop a node and get the nodecreated event, I expect area.area.pointer to return the position of the mouse. However it gets me the position of where I started my drag-and-drop operation on the dock.
nodecreated
area.area.pointer
You can observe the issue with this code
editor.addPipe((context) => { if (context.type === 'nodecreated') { console.log(area.area.pointer); } });
I believe it is due to how the browser handles drag/drop. Indeed try this code:
window.document.addEventListener('pointermove', (e) => { console.log(e.clientX, e.clientY) });
use case: I want to know on which existing node I dropped the node from the dock
is my workaround correct?: I listen on dragover event with a debounce
Is this issue still relevant?
you can close it. the workaround is good enough
When I drop a node and get the
nodecreated
event, I expectarea.area.pointer
to return the position of the mouse. However it gets me the position of where I started my drag-and-drop operation on the dock.You can observe the issue with this code
I believe it is due to how the browser handles drag/drop. Indeed try this code:
use case: I want to know on which existing node I dropped the node from the dock
is my workaround correct?: I listen on dragover event with a debounce