From 01d09cef01d0bb9cd45a77210e813f22ff6f2a82 Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 4 Sep 2025 22:04:35 +0200 Subject: [PATCH] fix(input): issues with typing accented characters in certain linux distros --- frontend/src/ts/controllers/input-controller.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/ts/controllers/input-controller.ts b/frontend/src/ts/controllers/input-controller.ts index 3d60b3eed..3f2f16a0c 100644 --- a/frontend/src/ts/controllers/input-controller.ts +++ b/frontend/src/ts/controllers/input-controller.ts @@ -1473,10 +1473,16 @@ $("#wordsInput").on("select selectstart", (event) => { }); $("#wordsInput").on("selectionchange", (event) => { - event.preventDefault(); const target = event.target as HTMLInputElement; const value = target.value; - target.setSelectionRange(value.length, value.length); + + const hasSelectedText = target.selectionStart !== target.selectionEnd; + const isCursorAtEnd = target.selectionStart === value.length; + + if (hasSelectedText || !isCursorAtEnd) { + // force caret at end of input + target.setSelectionRange(value.length, value.length); + } }); $("#wordsInput").on("keydown", (event) => {