Skip to content

Commit

Permalink
FIX: J/K navigation resets current selection when scrolling fast.
Browse files Browse the repository at this point in the history
Sometimes, when keeping J or K pressed and scrolling fast, the current
selection would go out of the viewport for a few moments and the
algorithm would try selecting the "best" element that is in viewport.

This bug is reproducible only on certain machines. For example, Linux
machines seem to be passing key events faster to the browser.
  • Loading branch information
udan11 committed Aug 16, 2019
1 parent 936d4ce commit df6630f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit df6630f

Please sign in to comment.