From a2c97b9e6bde310b523a1c06f23003ec105af957 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 15 Dec 2014 12:53:41 -0500 Subject: [PATCH] FIX: If a user uses the keyboard to navigate, don't bubble up the event. --- app/assets/javascripts/discourse/lib/keyboard_shortcuts.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js index fc331bf112c..624a5431124 100644 --- a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js +++ b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js @@ -189,7 +189,8 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ _bindToClick: function(selector, binding) { binding = binding.split(','); - this.keyTrapper.bind(binding, function() { + this.keyTrapper.bind(binding, function(e) { + e.preventDefault(); $(selector).click(); }); }, @@ -250,7 +251,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ } tabLoc.focus(); } - + var rgx = new RegExp("post-cloak-(\\d+)").exec($article.parent()[0].id); if (rgx === null || typeof rgx[1] === 'undefined') { this._scrollList($article, direction);