diff --git a/packages/editor-ui/src/components/canvas/Canvas.test.ts b/packages/editor-ui/src/components/canvas/Canvas.test.ts index beaa38edb2..afeb69479c 100644 --- a/packages/editor-ui/src/components/canvas/Canvas.test.ts +++ b/packages/editor-ui/src/components/canvas/Canvas.test.ts @@ -87,8 +87,6 @@ describe('Canvas', () => { }); it('should handle `update:nodes:position` event', async () => { - vi.useFakeTimers(); - const nodes = [createCanvasNodeElement()]; const { container, emitted } = renderComponent({ props: { @@ -112,8 +110,6 @@ describe('Canvas', () => { }); await fireEvent.mouseUp(node, { view: window }); - vi.advanceTimersByTime(250); // Event debounce time - expect(emitted()['update:nodes:position']).toEqual([ [ [ diff --git a/packages/editor-ui/src/components/canvas/Canvas.vue b/packages/editor-ui/src/components/canvas/Canvas.vue index 0d2b2cb4a3..254f9c705c 100644 --- a/packages/editor-ui/src/components/canvas/Canvas.vue +++ b/packages/editor-ui/src/components/canvas/Canvas.vue @@ -271,6 +271,10 @@ function onNodeDragStop(event: NodeDragEvent) { onUpdateNodesPosition(event.nodes.map(({ id, position }) => ({ id, position }))); } +function onSelectionDragStop(event: NodeDragEvent) { + onUpdateNodesPosition(event.nodes.map(({ id, position }) => ({ id, position }))); +} + function onSetNodeActive(id: string) { props.eventBus.emit('nodes:action', { ids: [id], action: 'update:node:active' }); emit('update:node:active', id); @@ -644,6 +648,7 @@ provide(CanvasKey, { @move-start="onPaneMoveStart" @move-end="onPaneMoveEnd" @node-drag-stop="onNodeDragStop" + @selection-drag-stop="onSelectionDragStop" >