From cc14f18fd2733cd4a10f013bf16e4ded6893bef7 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 17 Jan 2026 16:31:36 -0500 Subject: [PATCH] fix: Incorrect reuse of NodeViews with drag and drop (#11208) closes #11199 --- app/editor/components/ComponentView.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/editor/components/ComponentView.tsx b/app/editor/components/ComponentView.tsx index fa2d8db93a..4177f547f8 100644 --- a/app/editor/components/ComponentView.tsx +++ b/app/editor/components/ComponentView.tsx @@ -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() {