From 67273fe1b663f7ed3ad55c6cb185897560979815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Wed, 25 Mar 2026 15:45:06 +0400 Subject: [PATCH] Fix table dragging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- packages/ui/src/RichEditor/OptionsMenu.tsx | 6 +++--- packages/ui/src/RichEditor/RichEditor.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/RichEditor/OptionsMenu.tsx b/packages/ui/src/RichEditor/OptionsMenu.tsx index 8d11ee387..3cb727616 100644 --- a/packages/ui/src/RichEditor/OptionsMenu.tsx +++ b/packages/ui/src/RichEditor/OptionsMenu.tsx @@ -46,8 +46,8 @@ function findClosestRootBlock(element: Element, editorDom: Element): HTMLElement return current?.parentElement === editorDom ? (current as HTMLElement) : null; } -function startDrag(view: EditorView, slice: ReturnType) { - view.dragging = { slice, move: true }; +function startDrag(view: EditorView, slice: ReturnType, node: NodeSelection) { + view.dragging = { slice, move: true, node } as typeof view.dragging; } type OptionsMenuProps = { @@ -281,7 +281,7 @@ export function OptionsMenu({ editor }: OptionsMenuProps) { document.addEventListener("drop", () => wrapper.remove(), { once: true }); } - startDrag(view, slice); + startDrag(view, slice, selection); } catch { // Block may no longer be in the document } diff --git a/packages/ui/src/RichEditor/RichEditor.tsx b/packages/ui/src/RichEditor/RichEditor.tsx index e6b1d2ddf..9aaba007a 100644 --- a/packages/ui/src/RichEditor/RichEditor.tsx +++ b/packages/ui/src/RichEditor/RichEditor.tsx @@ -65,7 +65,7 @@ const extensions = [ ]; const richEditorVariants = tv({ - base: ["h-full px-12"], + base: ["h-full pl-14"], }); type RichEditorProps = ComponentProps<"div"> & {