Fix for greedy focus issue #320

This commit is contained in:
Irakli Gozalishvili 2011-06-30 13:53:10 +02:00
commit 4803f92145

View file

@ -65,6 +65,10 @@ var TextInput = function(parentNode, host) {
host.onTextInput(value);
} else
host.onTextInput(value);
// If editor is no longer focused we quit immediately, since
// it means that something else like CLI is in charge now.
if (!isFocused()) return false;
}
}
copied = false;
@ -215,6 +219,11 @@ var TextInput = function(parentNode, host) {
text.blur();
};
function isFocused() {
return document.activeElement === text;
};
this.isFocused = isFocused;
this.getElement = function() {
return text;
};