From a4db7891fd130f198732068b41bf7c7dd57cd8cf Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Wed, 3 Dec 2014 14:29:53 +0200 Subject: Fixes #171, Fixes #137 One line, two changes: keypress->keydown: - fixes #137. Chrome doesn't dispatch a keypressed on tab. Firefox and chrome both dispatch a keydown, so this works in both. $(document)->element: - fixes #171. Don't listen to text input events globally, only on the element. --- src/textanalysis.ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/textanalysis.ui.js b/src/textanalysis.ui.js index f41ebaa5..277d847e 100644 --- a/src/textanalysis.ui.js +++ b/src/textanalysis.ui.js @@ -119,8 +119,9 @@ return { var document_keypress = new Bacon.Bus(); rz_bus.ui_key.plug(document_keypress); - $(document).keypress(function(e) { + element.keydown(function(e) { var ret = undefined; + switch (e.keyCode) { case 9: //TAB e.preventDefault(); -- cgit v1.3.1