You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the onDrop event handler assumes determines the position to place a node when the on drop event fires based on the clientX and clientY properties of the drop event, correcting for the Chart's offset.
This works when the canvas is in the top left hand corner of the document. However, when the Canvas is positioned to the right, or down, the clientX and clientY values do not correspond to the position of a users mouse when the drop event occurred.
Proposing making the following change to the onDrop method that gets passed to ComponentInner in Canvas.wrapper.tsx
Looks like the offset is already being stored in state, and updated through the resize observer, just not being used when calculating the position property of the new node created on the onDrop event.
Made a PR that adds it in, since it seems pretty cut and dry and unlikely to affect anything else #34
Right now the onDrop event handler assumes determines the position to place a node when the on drop event fires based on the
clientX
andclientY
properties of the drop event, correcting for the Chart's offset.This works when the canvas is in the top left hand corner of the document. However, when the Canvas is positioned to the right, or down, the
clientX
andclientY
values do not correspond to the position of a users mouse when the drop event occurred.Proposing making the following change to the
onDrop
method that gets passed toComponentInner
in Canvas.wrapper.tsxthis would get the actual offset of the HTML element on the page and include this when calculating where the node should drop.
Does anyone see any issues with this? Should I make a PR?
The text was updated successfully, but these errors were encountered: