fix(input): issues with typing accented characters in certain linux distros

This commit is contained in:
Miodec 2025-09-04 22:04:35 +02:00
parent b783865e5f
commit 01d09cef01

View file

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