diff --git a/lib/ace/ace.js b/lib/ace/ace.js index 935bd624..72ac134e 100644 --- a/lib/ace/ace.js +++ b/lib/ace/ace.js @@ -38,6 +38,7 @@ define(function(require, exports, module) { require("pilot/index"); + require("pilot/fixoldbrowsers"); var catalog = require("pilot/plugin_manager").catalog; catalog.registerPlugins([ "pilot/index" ]); diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index 03120a35..ecd9a9e6 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -98,12 +98,17 @@ var TextInput = function(parentNode, host) { host.onCompositionUpdate(text.value); }; - var onCompositionEnd = function() { + var onCompositionEnd = function(e) { inCompostion = false; host.onCompositionEnd(); - setTimeout(function () { - sendText(); - }, 0); + if (useragent.isGecko) { + sendText(); + } else { + setTimeout(function () { + if (!inCompostion) + sendText(); + }, 0); + } }; var onCopy = function(e) {