mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Handle non-composition input when IME is active
This commit is contained in:
@@ -239,6 +239,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
CompositionHelper.prototype.handleAnyTextareaChanges = function() {
|
||||
var oldValue = this.textarea.value;
|
||||
|
||||
var self = this;
|
||||
setTimeout(function() {
|
||||
// Ensure no composition has started since the timeout
|
||||
if (!self.isComposing) {
|
||||
var newValue = self.textarea.value;
|
||||
var diff = newValue.replace(oldValue, '');
|
||||
if (diff.length > 0) {
|
||||
self.terminal.handler(diff);
|
||||
}
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the composition view's position.
|
||||
*/
|
||||
@@ -2619,6 +2635,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (ev.keyCode === 229) {
|
||||
this.compositionHelper.handleAnyTextareaChanges();
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
var result = this.evaluateKeyEscapeSequence(ev);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user