diff --git a/ts/reviewer/index.ts b/ts/reviewer/index.ts index 17c57f5e0..c382f5182 100644 --- a/ts/reviewer/index.ts +++ b/ts/reviewer/index.ts @@ -249,6 +249,11 @@ const dummyButton = document.createElement("button"); dummyButton.style.position = "absolute"; dummyButton.style.left = "-9999px"; document.addEventListener("focusout", (event) => { + // Prevent type box from losing focus when switching IMEs + if (!document.hasFocus()) { + return; + } + const target = event.target; if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) { document.body.appendChild(dummyButton);