diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index 3f0cb9dc..af6fe1b7 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -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.