From a9eda79e73d6c2f85cf5fda3c1068ffe54c9c14e Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 14 Jul 2026 11:04:14 +0800 Subject: [PATCH] fix(dashboard): Fix the issue where the dashboard editing interface cannot perform cmd+c copying --- frontend/src/views/dashboard/canvas/CanvasCore.vue | 6 +++++- frontend/src/views/dashboard/canvas/CanvasShape.vue | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/dashboard/canvas/CanvasCore.vue b/frontend/src/views/dashboard/canvas/CanvasCore.vue index 7fe3a84a..6a58d220 100644 --- a/frontend/src/views/dashboard/canvas/CanvasCore.vue +++ b/frontend/src/views/dashboard/canvas/CanvasCore.vue @@ -727,7 +727,11 @@ function startResize(e: MouseEvent, point: string, item: CanvasItem, index: numb infoBox.value.point = point } -function containerClick() { +function containerClick(e?: MouseEvent) { + // Ignore clicks that originate inside a component so interacting with component + // content (e.g. selecting/copying cells in an S2 table) does not clear the + // current selection. Only blank-canvas clicks deselect. + if ((e?.target as HTMLElement)?.closest?.('.item')) return // remove current component info dashboardStore.setCurComponent(null) } diff --git a/frontend/src/views/dashboard/canvas/CanvasShape.vue b/frontend/src/views/dashboard/canvas/CanvasShape.vue index f49de87f..a498b359 100644 --- a/frontend/src/views/dashboard/canvas/CanvasShape.vue +++ b/frontend/src/views/dashboard/canvas/CanvasShape.vue @@ -52,7 +52,11 @@ const props = defineProps({ const { draggable } = toRefs(props) const shapeClick = (e: MouseEvent) => { - e.stopPropagation() + // Do not stopPropagation here: the click must reach window so components that + // rely on a window-level click listener (e.g. the S2 table copy interaction, + // which only enables Cmd/Ctrl+C when the last click landed on its canvas) work + // inside the editor. Deselection is handled by containerClick ignoring clicks + // that originate inside a component. e.preventDefault() }