From cfb08691c25ff7a8d1b8f862778891daae9121b5 Mon Sep 17 00:00:00 2001 From: Neil Jenkins Date: Thu, 29 Mar 2012 17:54:05 +1100 Subject: [PATCH] Don't focus body in non-Gecko. Opera loses selection. Only Gecko seems to need it. --- source/Editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/Editor.js b/source/Editor.js index fc991c1..ac8cc08 100644 --- a/source/Editor.js +++ b/source/Editor.js @@ -21,6 +21,7 @@ var isOpera = !!win.opera; var isIE = !!win.ie; + var isGecko = /Gecko\//.test( navigator.userAgent ); var isIOS = /iP(?:ad|hone|od)/.test( navigator.userAgent ); var useTextFixer = isIE || isOpera; @@ -189,7 +190,9 @@ var focus = function () { // FF seems to need the body to be focussed // (at least on first load). - body.focus(); + if ( isGecko ) { + body.focus(); + } win.focus(); };