linux ime

This commit is contained in:
nightwing 2013-04-30 13:29:29 +04:00
commit 6d4b91f89f

View file

@ -387,7 +387,7 @@ var TextInput = function(parentNode, host) {
inComposition = false; inComposition = false;
var timer = setTimeout(function() { var timer = setTimeout(function() {
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)
return return
else if (str == c.lastValue) else if (str == c.lastValue)
@ -403,10 +403,8 @@ var TextInput = function(parentNode, host) {
str = str.replace(/\x01/g, ""); str = str.replace(/\x01/g, "");
if (str == c.lastValue) if (str == c.lastValue)
return ""; return "";
if (str) {
if (c.lastValue) if (c.lastValue)
host.undo(); host.undo();
}
return str; return str;
} }
host.onCompositionEnd(); host.onCompositionEnd();