From 473e2958c08f8e6b920952213374264b66b6da71 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Fri, 29 Apr 2022 17:10:23 +0800 Subject: [PATCH] tiptap: fix copy selection node --- packages/client/src/tiptap/extensions/paste.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/packages/client/src/tiptap/extensions/paste.ts b/packages/client/src/tiptap/extensions/paste.ts index f798779..78cb6ef 100644 --- a/packages/client/src/tiptap/extensions/paste.ts +++ b/packages/client/src/tiptap/extensions/paste.ts @@ -148,21 +148,8 @@ export const Paste = Extension.create({ */ if ((event.ctrlKey || event.metaKey) && event.keyCode == 67) { const { state } = view; - const $pos = state.selection.$anchor; // @ts-ignore const currentNode = state.selection.node; - let targetNode = null; - - if (currentNode) { - targetNode = currentNode; - } else { - if ($pos.depth) { - for (let d = $pos.depth; d > 0; d--) { - const node = $pos.node(d); - targetNode = node; - } - } - } if (currentNode) { event.preventDefault();