mirror of
https://github.com/outline/outline.git
synced 2026-11-25 23:24:06 +03:00
fix: Incorrect reuse of NodeViews with drag and drop (#11208)
closes #11199
This commit is contained in:
1 parent
8b18d5e93f
commit
cc14f18fd2
1 file changed
+14
-1
@@ -84,6 +84,15 @@ export default class ComponentView {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ensure we don't reuse NodeViews for different nodes that have a distinct identity
|
||||
// This prevents attribute swapping during drag operations.
|
||||
if (
|
||||
this.node.attrs.id !== undefined &&
|
||||
node.attrs.id !== this.node.attrs.id
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.node = node;
|
||||
this.decorations = decorations;
|
||||
this.applyDecorationClasses();
|
||||
@@ -137,7 +146,11 @@ export default class ComponentView {
|
||||
}
|
||||
|
||||
stopEvent(event: Event) {
|
||||
return event.type !== "mousedown" && !event.type.startsWith("drag");
|
||||
return (
|
||||
event.type !== "mousedown" &&
|
||||
!event.type.startsWith("drag") &&
|
||||
!event.type.startsWith("drop")
|
||||
);
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
Reference in new issue
Block a user