From 86ec6c379c017492921929da47f9e65be6618e4a Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 26 Jan 2011 17:15:53 +0100 Subject: [PATCH] focus immediately and in a timeout --- lib/ace/editor.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ace/editor.js b/lib/ace/editor.js index efa1cb9a..6be9b875 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -221,6 +221,13 @@ var Editor =function(renderer, session) { }; this.focus = function() { + // Safari need the timeout + // iOS and Firefox need it called immediately + // to be on the save side we do both + var _self = this; + setTimeout(function() { + _self.textInput.focus(); + }); this.textInput.focus(); };