From 8f2949ffb67e3b475643ef1f9acb151d2b16ad58 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 9 Mar 2011 08:35:44 +0000 Subject: [PATCH] don't timeout focus in IE --- lib/ace/editor.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/ace/editor.js b/lib/ace/editor.js index b204a8f8..31c62aa0 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -245,13 +245,16 @@ var Editor =function(renderer, session) { }; this.focus = function() { - // Safari need the timeout + // Safari needs the timeout // iOS and Firefox need it called immediately // to be on the save side we do both + // except for IE var _self = this; - setTimeout(function() { - _self.textInput.focus(); - }); + if (!useragent.isIE) { + setTimeout(function() { + _self.textInput.focus(); + }); + } this.textInput.focus(); };