дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 19:25:54 +02:00
fix(keymap): Don't run the Enter that commits an input-method candidate
WebKit sends the Enter (or Space) that commits a candidate after compositionend, with isComposing already false and keyCode 229. Handlers that checked isComposing alone ran it: dialogs confirmed and shortcuts fired while typing Chinese or Japanese. isImeKey() checks both, and every keydown handler that skipped composition uses it.
Цей коміт міститься в:
1 джерело
2c576418cb
коміт
f73c0a6b1d
10 files changed
+26
-9
No files matched your search
@@ -8,6 +8,7 @@ import { FOCUSABLE, onWindowDeactivate, openLayer, trapTab } from "./popupState"
|
||||
import { useTx } from "@/platform/i18n";
|
||||
import { selectableText } from "./selectableText";
|
||||
import styles from "./Dialog.module.css";
|
||||
import { isImeKey } from "@/platform/ime";
|
||||
|
||||
/**
|
||||
* `default`: filled accent button, triggered by Enter. `cancel`: Esc / close
|
||||
@@ -256,7 +257,7 @@ function DialogInner({
|
||||
onCloseRef.current();
|
||||
} else if (e.key === "Tab") {
|
||||
trapTab(e, ref.current);
|
||||
} else if (e.key === "Enter" && !e.defaultPrevented && !e.isComposing && !e.shiftKey && !e.altKey) {
|
||||
} else if (e.key === "Enter" && !e.defaultPrevented && !isImeKey(e) && !e.shiftKey && !e.altKey) {
|
||||
const t = e.target instanceof Element ? e.target : null;
|
||||
const mod = e.metaKey || e.ctrlKey;
|
||||
if (t && t !== document.body && !ref.current.contains(t)) return;
|
||||
|
||||
Reference in new issue
Заблокувати користувача