Skip to content

Commit

Permalink
Fix : React DND broken when used within a NodeViewWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Tejendra Singh authored and Tejendra Singh committed Apr 1, 2024
1 parent 9dcb3c6 commit c859f2e
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 @@ -135,11 +135,11 @@ export class NodeView<
// ProseMirror tries to drag selectable nodes
// even if `draggable` is set to `false`
// this fix prevents that
if (!isDraggable && isSelectable && isDragEvent) {
if (!isDraggable && isSelectable && isDragEvent && event.target === this.dom) {
event.preventDefault()
}

if (isDraggable && isDragEvent && !isDragging) {
if (isDraggable && isDragEvent && !isDragging && event.target === this.dom) {
event.preventDefault()
return false
}
Expand Down

0 comments on commit c859f2e

Please sign in to comment.