Fix non-composition char input after composition char + test

This commit is contained in:
Daniel Imms
2016-07-13 21:02:43 -07:00
parent ac8db6e8ec
commit 89d29bbc10
2 changed files with 33 additions and 4 deletions
+10 -1
View File
@@ -232,7 +232,16 @@
// Ensure that the input has not already been sent
if (self.isSendingComposition) {
self.isSendingComposition = false;
var input = self.textarea.value.substring(currentCompositionPosition.start, currentCompositionPosition.end);
var input;
if (self.isComposing) {
// Use the end position to get the string if a new composition has started.
input = self.textarea.value.substring(currentCompositionPosition.start, currentCompositionPosition.end);
} 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
// (eg. 2) after a composition character.
input = self.textarea.value.substring(currentCompositionPosition.start);
}
self.terminal.handler(input);
}
}, 0);