Merge pull request #321 from Gozala/bugs/focus.greedy-320

Fix for greedy focus issue #320
This commit is contained in:
Fabian Jakobs 2011-06-30 05:01:41 -07:00
commit 3cb6ded6b2

View file

@ -66,6 +66,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;
@ -221,6 +225,11 @@ var TextInput = function(parentNode, host) {
text.blur();
};
function isFocused() {
return document.activeElement === text;
};
this.isFocused = isFocused;
this.getElement = function() {
return text;
};