From 0a6c8bae104068ea61dcbf041479da4d3989b096 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 25 Nov 2014 22:28:57 +0200 Subject: 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. --- src/textanalysis.ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/textanalysis.ui.js') 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(); -- cgit v1.3.1