From e78e9e419e4c2b3cefa6ffabd9814f625d8bf633 Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 9 Apr 2025 19:56:01 +0800 Subject: [PATCH] fix: simplify move command by directly assigning command string --- .../core/src/dom_components/model/Component.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/core/src/dom_components/model/Component.ts b/packages/core/src/dom_components/model/Component.ts index adc946493..c9f0cbf26 100644 --- a/packages/core/src/dom_components/model/Component.ts +++ b/packages/core/src/dom_components/model/Component.ts @@ -1146,21 +1146,7 @@ export default class Component extends StyleableModel { tb.push({ attributes: { class: `${ppfx}no-touch-actions`, draggable: true }, label: em.getIcon('move'), - command: (ed) => { - const targets = ed.getSelectedAll(); - - targets.forEach((target) => { - const rect = target?.view?.el.getBoundingClientRect(); - const clientX = rect ? rect.left + rect.width / 2 : 0; - const clientY = rect ? rect.top + rect.height / 2 : 0; - - // tld-move event needs to be called with a target and a drag event - ed.runCommand('tlb-move', { - target, - event: new DragEvent('dragstart', { clientX, clientY }), - }); - }); - }, + command: 'tlb-move', }); model.get('copyable') && tb.push({