From 0b6409ab3935313f860b1b70f1f564d2de7764e0 Mon Sep 17 00:00:00 2001 From: 64 <172265251+64qq@users.noreply.github.com> Date: Tue, 3 Dec 2024 23:31:43 +0900 Subject: [PATCH] Prevent typing using the IME and discard composition sessions --- src/services/saneKeyboardEvents.util.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/services/saneKeyboardEvents.util.ts b/src/services/saneKeyboardEvents.util.ts index 8aa8964fe..f99ffdc8e 100644 --- a/src/services/saneKeyboardEvents.util.ts +++ b/src/services/saneKeyboardEvents.util.ts @@ -302,6 +302,16 @@ var saneKeyboardEvents = (function () { (keydown.key === 'U' || keydown.key === 'Process'))) ) return; + if (keydown?.key === 'Process') { + // Force the current composition session of the input method editor to be cleared + textarea.blur(); + setTimeout(() => { + textarea.value = ''; + textarea.focus(); + }); + return; + } + if (text.length === 1) { textarea.value = ''; if (controller.options && controller.options.overrideTypedText) {