fix(sql-library): restore Ctrl+click multi-select on Windows (#2470)

This commit is contained in:
一颗红心 authored and GitHub committed 2026-07-03 11:12:49 +08:00
1 parent 6f2e4774f4
commit 69bfd59c3c
1 file changed
+3 -1
+3 -1
View File
@@ -41,6 +41,7 @@ import { findTreeNodeById, resolveNewQueryTarget } from "@/lib/newQueryContext";
import { buildExecutableObjectSourceStatements, objectSourceSaveExecutionMode } from "@/lib/objectSourceEditor"; import { buildExecutableObjectSourceStatements, objectSourceSaveExecutionMode } from "@/lib/objectSourceEditor";
import { resolveExecutableSql, resolveExecutableSqlWithBackend, type SqlExecutionSnapshot } from "@/lib/sqlExecutionTarget"; import { resolveExecutableSql, resolveExecutableSqlWithBackend, type SqlExecutionSnapshot } from "@/lib/sqlExecutionTarget";
import { uuid } from "@/lib/utils"; import { uuid } from "@/lib/utils";
import { isMacOS } from "@/lib/platform";
import { isTauriRuntime } from "@/lib/tauriRuntime"; import { isTauriRuntime } from "@/lib/tauriRuntime";
import { openQueryResultArchiveFile } from "@/lib/queryResultArchiveFile"; import { openQueryResultArchiveFile } from "@/lib/queryResultArchiveFile";
import { sqlFileTitleFromPath } from "@/lib/sqlFileOpen"; import { sqlFileTitleFromPath } from "@/lib/sqlFileOpen";
@@ -1639,10 +1640,11 @@ onMounted(async () => {
} }
// macOS: Ctrl+click fires both click and contextmenu. // macOS: Ctrl+click fires both click and contextmenu.
// Intercept click in capture phase to prevent unwanted navigation. // Intercept click in capture phase to prevent unwanted navigation.
// Windows/Linux use Ctrl+click for multi-select; do not block there.
document.addEventListener( document.addEventListener(
"click", "click",
(e) => { (e) => {
if (e.ctrlKey) e.stopPropagation(); if (e.ctrlKey && isMacOS()) e.stopPropagation();
}, },
true, true,
); );