Skip to content

A platform for community discussion. Free, open, simple.

FIX: J/K navigation resets current selection when scrolling fast.

Dan Ungureanudf6630f86898
diff --git a/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6 b/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6
index 5e0a3996ea3..664a1cbdc6a 100644
--- a/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6
+++ b/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6
@@ -441,7 +441,7 @@ export default {
// Discard selection if it is not in viewport, so users can combine
// keyboard shortcuts with mouse scrolling.
- if ($selected.length !== 0) {
+ if ($selected.length !== 0 && !fast) {
const offset = minimumOffset();
const beginScreen = $(window).scrollTop() - offset;
const endScreen = beginScreen + window.innerHeight + offset;