Skip to content

Commit

Permalink
Merge pull request #5024 from ksqsf/master
Browse files Browse the repository at this point in the history
Fix duplicate input for some IMEs
  • Loading branch information
Tyriar committed Apr 8, 2024
2 parents 9ba6c00 + 52e8a75 commit 887e5a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/browser/input/CompositionHelper.ts
Expand Up @@ -159,8 +159,9 @@ export class CompositionHelper {
// otherwise input characters can be duplicated. (Issue #3191)
currentCompositionPosition.start += this._dataAlreadySent.length;
if (this._isComposing) {
// Use the end position to get the string if a new composition has started.
input = this._textarea.value.substring(currentCompositionPosition.start, currentCompositionPosition.end);
// Use the start position of the new composition to get the string
// if a new composition has started.
input = this._textarea.value.substring(currentCompositionPosition.start, this._compositionPosition.start);
} else {
// Don't use the end position here in order to pick up any characters after the
// composition has finished, for example when typing a non-composition character
Expand Down

0 comments on commit 887e5a6

Please sign in to comment.