From d03bc79a78be89d1b624ddbc09a9047839925451 Mon Sep 17 00:00:00 2001 From: Shelane French Date: Thu, 20 Dec 2018 19:22:04 -0800 Subject: [PATCH] prevents left and right keydown in input fields If input field is in focus, keydown event to trigger navigation change should not fire. User should expect cursor to stay in input field when using arrow keys. --- static/js/learn.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/js/learn.js b/static/js/learn.js index d1acd4c275..1b5d59ffb6 100644 --- a/static/js/learn.js +++ b/static/js/learn.js @@ -223,6 +223,13 @@ jQuery(document).ready(function() { }); }); + jQuery('input').keydown(function (e) { + // left and right arrow keys + if (e.which == '37' || e.which == '39') { + e.stopPropagation(); + } + }); + jQuery(document).keydown(function(e) { // prev links - left arrow key if(e.which == '37') {