mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-12 00:19:02 +08:00
Fix : React DND broken when used within a NodeViewWrapper (#5023)
* Fix : React DND broken when used within a NodeViewWrapper * added changeset --------- Co-authored-by: Tejendra Singh <tejendrasingh@Tejendras-MacBook-Pro.local> Co-authored-by: Dominik Biedebach <dominik.biedebach@tiptap.dev>
This commit is contained in:
parent
722ec00fb2
commit
b7ef150d33
5
.changeset/stupid-shrimps-speak.md
Normal file
5
.changeset/stupid-shrimps-speak.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@tiptap/core": patch
|
||||
---
|
||||
|
||||
Fixed an issue with nodeviews preventing any drag events in child nodes of the nodeview wrapper element
|
@ -151,11 +151,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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user