From cb9bdd120c4fe80577cacefd424448feddf9f5b4 Mon Sep 17 00:00:00 2001 From: c-spencer Date: Fri, 20 May 2011 18:49:59 +0100 Subject: [PATCH] Fixes for #240 and #255 --- lib/ace/ace.js | 1 + lib/ace/keyboard/textinput.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) 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) {