Merge pull request #321 from Gozala/bugs/focus.greedy-320
Fix for greedy focus issue #320
This commit is contained in:
commit
3cb6ded6b2
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue