From 0d461f16a7914e8a46ad3e13c01dbd5dc9141aef Mon Sep 17 00:00:00 2001 From: Kelle Connolly Date: Wed, 22 Oct 2014 17:29:16 +1100 Subject: [PATCH] Remove href attribute from tab link to prevent duplicate event on enter. Because Discourse doesn't preventDefault on links with an href of "#" this tab-able link was firing a click event when enter was pressed. This had the unfortunate side effect of breaking the history, making routing and navigation unreliable. --- app/assets/javascripts/discourse/lib/keyboard_shortcuts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js index 8a8836bd54f..aaf4213eb59 100644 --- a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js +++ b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js @@ -237,7 +237,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ if ($article.is('.topic-post')) { var tabLoc = $article.find('a.tabLoc'); if (tabLoc.length === 0) { - tabLoc = $(''); + tabLoc = $(''); $article.prepend(tabLoc); } tabLoc.focus();