fix(editor): guard SQL shortcuts during IME composition

This commit is contained in:
jearhe authored and GitHub committed 2026-08-25 22:51:26 +08:00
1 parent 0658d18922
commit 0dc1f0c14c
7 files changed
+348 -7

No files matched your search

+4 -2
View File
@@ -2621,16 +2621,18 @@ async function handleKeydown(e: KeyboardEvent) {
void openSaveSqlDialog();
return;
}
// CodeMirror ignores keydown events after an IME composition changes the
// document, so this app-level fallback must share the editor shortcut guard.
if (activeTab.value?.mode === "query" && isExecuteSqlInNewResultTabShortcut(e, shortcuts) && e.target instanceof Element && e.target.closest("[data-query-editor-root]")) {
e.preventDefault();
e.stopPropagation();
requestActiveEditorExecuteInNewResultTab();
if (!contentAreaRef.value?.shouldBlockQueryEditorExecutionShortcut?.(e)) requestActiveEditorExecuteInNewResultTab();
return;
}
if (activeTab.value?.mode === "query" && isExecuteSqlShortcut(e, shortcuts) && e.target instanceof Element && e.target.closest("[data-query-editor-root]")) {
e.preventDefault();
e.stopPropagation();
requestActiveEditorExecute();
if (!contentAreaRef.value?.shouldBlockQueryEditorExecutionShortcut?.(e)) requestActiveEditorExecute();
return;
}
if (activeTab.value?.mode === "query" && isSendSelectionToAiShortcut(e, shortcuts) && e.target instanceof Element && e.target.closest("[data-query-editor-root]")) {