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) => {