fix #1286 ibus Chinese input issue
This commit is contained in:
parent
f514330729
commit
5fa2af1991
1 changed files with 5 additions and 2 deletions
|
|
@ -210,7 +210,8 @@ var TextInput = function(parentNode, host) {
|
|||
host.onPaste(data);
|
||||
pasted = false;
|
||||
} else if (data == PLACEHOLDER[0]) {
|
||||
host.execCommand("del", {source: "ace"});
|
||||
if (Date.now() - lastCompositionTime > 100)
|
||||
host.execCommand("del", {source: "ace"});
|
||||
} else {
|
||||
if (data.substring(0, 2) == PLACEHOLDER)
|
||||
data = data.substr(2);
|
||||
|
|
@ -355,10 +356,12 @@ var TextInput = function(parentNode, host) {
|
|||
if (!inCompostion) return;
|
||||
host.onCompositionUpdate(text.value);
|
||||
};
|
||||
|
||||
|
||||
var lastCompositionTime = -1;
|
||||
var onCompositionEnd = function(e) {
|
||||
inCompostion = false;
|
||||
host.onCompositionEnd();
|
||||
lastCompositionTime = Date.now();
|
||||
};
|
||||
|
||||
var syncComposition = lang.delayedCall(onCompositionUpdate, 50);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue