Skip to content

Commit

Permalink
#7972 Typing Thai vowel in textbox will skip the next character
Browse files Browse the repository at this point in the history
Fixes #7972
  • Loading branch information
novikov82 committed Mar 14, 2024
1 parent ad5a0c1 commit 9141a65
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,13 @@ export function sanitizeEditableContent(element: any, cleanLineBreaks: boolean =
selection.removeAllRanges();
selection.addRange(range);

for (let i = 0; i < innerText.length - tail_len; i++) {
(selection as any).modify("move", "forward", "character");
while (selection.toString().length < innerText.length - tail_len) {
const selLen = selection.toString().length;
(selection as any).modify("extend", "forward", "character");
if (selection.toString().length == selLen) break;
}
range = selection.getRangeAt(0);
range.setStart(range.endContainer, range.endOffset);
}
}
function mergeValues(src: any, dest: any) {
Expand Down

0 comments on commit 9141a65

Please sign in to comment.