fix(shortcuts): try to fix ime composition checks

This commit is contained in:
perf3ct
2025-09-01 16:21:58 +00:00
parent 83be42f4ea
commit a2acb3cbb7
6 changed files with 86 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import "./note_title.css";
import { isLaunchBarConfig } from "../services/utils";
import appContext from "../components/app_context";
import branches from "../services/branches";
import { isIMEComposing } from "../services/shortcuts";
export default function NoteTitleWidget() {
const { note, noteId, componentId, viewScope, noteContext, parentComponent } = useNoteContext();
@@ -78,6 +79,12 @@ export default function NoteTitleWidget() {
spacedUpdate.scheduleUpdate();
}}
onKeyDown={(e) => {
// Skip processing if IME is composing to prevent interference
// with text input in CJK languages
if (isIMEComposing(e)) {
return;
}
// Focus on the note content when pressing enter.
if (e.key === "Enter") {
e.preventDefault();