From b9ab95af4e99228d3b5f119de964b2bb65ce3ed7 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sun, 24 May 2026 12:28:16 +0100 Subject: [PATCH] Revert "fix(base): isolate inline-embed drags from prosemirror dropcursor" This reverts commit 3c623318261a7a498d4265ac57178809914c099a. --- .../components/base-embed/base-embed-view.tsx | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/apps/client/src/features/editor/components/base-embed/base-embed-view.tsx b/apps/client/src/features/editor/components/base-embed/base-embed-view.tsx index 0ada663fa..a0a7ebfa2 100644 --- a/apps/client/src/features/editor/components/base-embed/base-embed-view.tsx +++ b/apps/client/src/features/editor/components/base-embed/base-embed-view.tsx @@ -71,34 +71,6 @@ export function BaseEmbedView({ node }: NodeViewProps) { }; }, [isLoading, isError, pageId]); - // Isolate the embed's internal drags (column reorder, choice reorder) - // from the surrounding ProseMirror editor. Without this, native drag - // events bubble up to prosemirror-dropcursor's handleDOMEvents listener, - // which then paints its own blue indicator at the embed's node boundary - // — visible as a horizontal line above/below the table during a column - // drag. Pragmatic-dnd binds its own listeners with `{capture: true}` on - // window, so they fire BEFORE bubbling starts; stopping bubble-phase - // propagation at the wrapper leaves pragmatic-dnd unaffected while - // preventing the editor's listeners from seeing the events. - useEffect(() => { - const wrapper = wrapperRef.current; - if (!wrapper) return; - const stop = (e: Event) => e.stopPropagation(); - const events = [ - "dragstart", - "drag", - "dragenter", - "dragover", - "dragleave", - "drop", - "dragend", - ] as const; - for (const type of events) wrapper.addEventListener(type, stop); - return () => { - for (const type of events) wrapper.removeEventListener(type, stop); - }; - }, []); - let content: React.ReactNode; if (pendingKey) { // Slash command inserted the embed and is awaiting the server's