From a73a82e063f138ac5cac8b2a72cc958cb4493a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=86=A0?= Date: Thu, 7 May 2020 21:52:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=89=AA=E5=88=87=E5=BF=AB=E6=8D=B7=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/designer/src/designer/builtin-hotkey.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/designer/src/designer/builtin-hotkey.ts b/packages/designer/src/designer/builtin-hotkey.ts index d11edbe03..7831f95e3 100644 --- a/packages/designer/src/designer/builtin-hotkey.ts +++ b/packages/designer/src/designer/builtin-hotkey.ts @@ -58,14 +58,15 @@ hotkey.bind(['command+c', 'ctrl+c', 'command+x', 'ctrl+x'], (e, action) => { const data = { type: 'nodeSchema', componentsMap, componentsTree }; clipboard.setData(data); - /* + const cutMode = action.indexOf('x') > 0; if (cutMode) { - const parentNode = selected.getParent(); - parentNode.select(); - selected.remove(); + selected.forEach((node) => { + const parentNode = node.getParent(); + parentNode?.select(); + node.remove(); + }); } - */ }); // command + v paste