Select2 Page Up/Down List Scrolling
Asked Answered
N

0

6

Select2 eats the Page Up and Page Down key events to prevent the page from scrolling, but I want the active list to scroll when these keys are pressed.

The challenge is scrolling the list by the correct number of indices, or pixels, if possible. Naively, I am calling this.moveHighlight(-5); on KEY.PAGE_UP and similar for KEY.PAGE_DOWN.

What is the correct way to scroll the Select2 dropdown by exactly one page?

Here is the code that swallows the events:

if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
    // prevent the page from scrolling
    killEvent(e);
    return;
}
Nebulosity answered 11/4, 2013 at 13:34 Comment(1)
The issue on GithubDiscerning

© 2022 - 2024 — McMap. All rights reserved.