Fix table dragging

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-03-25 15:45:06 +04:00
parent 48206cbc36
commit 67273fe1b6
2 changed files with 4 additions and 4 deletions

View File

@@ -46,8 +46,8 @@ function findClosestRootBlock(element: Element, editorDom: Element): HTMLElement
return current?.parentElement === editorDom ? (current as HTMLElement) : null; return current?.parentElement === editorDom ? (current as HTMLElement) : null;
} }
function startDrag(view: EditorView, slice: ReturnType<NodeSelection["content"]>) { function startDrag(view: EditorView, slice: ReturnType<NodeSelection["content"]>, node: NodeSelection) {
view.dragging = { slice, move: true }; view.dragging = { slice, move: true, node } as typeof view.dragging;
} }
type OptionsMenuProps = { type OptionsMenuProps = {
@@ -281,7 +281,7 @@ export function OptionsMenu({ editor }: OptionsMenuProps) {
document.addEventListener("drop", () => wrapper.remove(), { once: true }); document.addEventListener("drop", () => wrapper.remove(), { once: true });
} }
startDrag(view, slice); startDrag(view, slice, selection);
} catch { } catch {
// Block may no longer be in the document // Block may no longer be in the document
} }

View File

@@ -65,7 +65,7 @@ const extensions = [
]; ];
const richEditorVariants = tv({ const richEditorVariants = tv({
base: ["h-full px-12"], base: ["h-full pl-14"],
}); });
type RichEditorProps = ComponentProps<"div"> & { type RichEditorProps = ComponentProps<"div"> & {