fix text input for old ie

This commit is contained in:
nightwing 2012-07-04 17:57:35 +04:00
commit 81b6e5916a

View file

@ -166,7 +166,24 @@ var TextInput = function(parentNode, host) {
};
event.addCommandKeyListener(text, host.onCommandKey.bind(host));
event.addListener(text, "input", useragent.isIE ? onPropertyChange : onTextInput);
event.addListener(text, "input", onTextInput);
if (useragent.isOldIE) {
var keytable = { 13:1, 27:1 };
event.addListener(text, "keyup", function (e) {
if (inCompostion && (!text.value || keytable[e.keyCode]))
setTimeout(onCompositionEnd, 0);
if ((text.value.charCodeAt(0)|0) < 129) {
return;
}
inCompostion ? onCompositionUpdate() : onCompositionStart();
});
event.addListener(text, "propertychange", function() {
if (text.value != PLACEHOLDER)
setTimeout(sendText, 0);
});
}
event.addListener(text, "paste", function(e) {
// Mark that the next input text comes from past.