[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;
|
var c = inComposition;
|
||||||
inComposition = false;
|
inComposition = false;
|
||||||
var timer = setTimeout(function() {
|
var timer = setTimeout(function() {
|
||||||
|
timer = null;
|
||||||
var str = text.value.replace(/\x01/g, "");
|
var str = text.value.replace(/\x01/g, "");
|
||||||
// console.log(str, c.lastValue)
|
// console.log(str, c.lastValue)
|
||||||
if (inComposition)
|
if (inComposition)
|
||||||
|
|
@ -407,14 +408,15 @@ var TextInput = function(parentNode, host) {
|
||||||
});
|
});
|
||||||
inputHandler = function compositionInputHandler(str) {
|
inputHandler = function compositionInputHandler(str) {
|
||||||
// console.log("onCompositionEnd", str, c.lastValue)
|
// console.log("onCompositionEnd", str, c.lastValue)
|
||||||
|
if (timer)
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
str = str.replace(/\x01/g, "");
|
str = str.replace(/\x01/g, "");
|
||||||
if (str == c.lastValue)
|
if (str == c.lastValue)
|
||||||
return "";
|
return "";
|
||||||
if (c.lastValue)
|
if (c.lastValue && timer)
|
||||||
host.undo();
|
host.undo();
|
||||||
return str;
|
return str;
|
||||||
}
|
};
|
||||||
host.onCompositionEnd();
|
host.onCompositionEnd();
|
||||||
host.removeListener("mousedown", onCompositionEnd);
|
host.removeListener("mousedown", onCompositionEnd);
|
||||||
if (e.type == "compositionend" && c.range) {
|
if (e.type == "compositionend" && c.range) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue