Skip to content

Commit

Permalink
fix: improve drag position for node views even more
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed Apr 8, 2021
1 parent 6029d74 commit d2c5b71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/NodeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export class NodeView<Component, Editor extends CoreEditor = CoreEditor> impleme

const domBox = this.dom.getBoundingClientRect()
const handleBox = target.getBoundingClientRect()
const x = handleBox.x - domBox.x
const y = handleBox.y - domBox.y
const x = handleBox.x - domBox.x + event.offsetX
const y = handleBox.y - domBox.y + event.offsetY

// sometimes `event.target` is not the `dom` element
event.dataTransfer?.setDragImage(this.dom, x, y)
Expand Down

0 comments on commit d2c5b71

Please sign in to comment.