mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
fix(dashboard): Fix the issue where the dashboard editing interface cannot perform cmd+c copying
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user