diff --git a/lib/ace/mouse/mouse_handler.js b/lib/ace/mouse/mouse_handler.js index d032e687..6b331eee 100644 --- a/lib/ace/mouse/mouse_handler.js +++ b/lib/ace/mouse/mouse_handler.js @@ -48,6 +48,10 @@ var MouseHandler = function(editor) { new DragdropHandler(this); var focusEditor = function(e) { + // because we have to call event.preventDefault() any window on ie and iframes + // on other browsers do not get focus, so we have to call window.focus() here + if (!document.hasFocus || !document.hasFocus()) + window.focus(); editor.focus(); };