summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-11-25 22:28:57 +0200
committerAlon Levy <alon@pobox.com>2014-11-25 22:31:54 +0200
commit0a6c8bae104068ea61dcbf041479da4d3989b096 (patch)
tree547acf77d52c541283af2c09af86e1e4d5bb1824
parent486fdb88f10de576c8d0f3d4c5f73072413162c5 (diff)
textanalysis.ui: fix for lingering #102 issue
After using up/down keys to select one of the entries you had an extra enter required to "complete" the sentence. Reproduce: ctrl-alt-i (focus on 'Type here to create a network', #textanalysis) The first enter is the selection, the second is ignored (the bug fixed by this commit), the third is handled by the #textanalysis keypress trigger. The fix was simple, not sure why it works. Seems there is a keyup/keypress interaction. The keyup was on the document element, replaced by a keypress on the same element.
-rw-r--r--src/textanalysis.ui.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/textanalysis.ui.js b/src/textanalysis.ui.js
index 7a68eb82..a8213421 100644
--- a/src/textanalysis.ui.js
+++ b/src/textanalysis.ui.js
@@ -96,7 +96,7 @@ return {
},
});
- $(document).keydown(function(e) {
+ $(document).keypress(function(e) {
signal.signal(consts.KEYSTROKES, [{where: consts.KEYSTROKE_WHERE_DOCUMENT, keys: [e.keyCode]}]);
if (e.keyCode == 9) {//TAB
e.preventDefault();