[IME] pressing enter on ie reverts last input
This commit is contained in:
parent
b0e40929b6
commit
b52a989bf8
1 changed files with 5 additions and 3 deletions
|
|
@ -394,6 +394,7 @@ var TextInput = function(parentNode, host) {
|
|||
var c = inComposition;
|
||||
inComposition = false;
|
||||
var timer = setTimeout(function() {
|
||||
timer = null;
|
||||
var str = text.value.replace(/\x01/g, "");
|
||||
// console.log(str, c.lastValue)
|
||||
if (inComposition)
|
||||
|
|
@ -407,14 +408,15 @@ var TextInput = function(parentNode, host) {
|
|||
});
|
||||
inputHandler = function compositionInputHandler(str) {
|
||||
// console.log("onCompositionEnd", str, c.lastValue)
|
||||
clearTimeout(timer);
|
||||
if (timer)
|
||||
clearTimeout(timer);
|
||||
str = str.replace(/\x01/g, "");
|
||||
if (str == c.lastValue)
|
||||
return "";
|
||||
if (c.lastValue)
|
||||
if (c.lastValue && timer)
|
||||
host.undo();
|
||||
return str;
|
||||
}
|
||||
};
|
||||
host.onCompositionEnd();
|
||||
host.removeListener("mousedown", onCompositionEnd);
|
||||
if (e.type == "compositionend" && c.range) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue