diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index 183260c9..3ad20179 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -63,7 +63,9 @@ var TextInput = function(parentNode, host) { var isSelectionEmpty = true; // FOCUS - var isFocused = document.activeElement === text; + // ie9 throws error if document.activeElement is accessed too soon + try { var isFocused = document.activeElement === text; } catch(e) {} + event.addListener(text, "blur", function() { host.onBlur(); isFocused = false;