mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 13:27:49 +08:00
catching the scrolling error
This commit is contained in:
parent
40a8c7093f
commit
7986e57036
1 changed files with 11 additions and 7 deletions
|
@ -1691,15 +1691,19 @@ $(document).keydown((e) => {
|
|||
hoverId = $(entries[activenum]).attr("command");
|
||||
}
|
||||
}
|
||||
let scroll =
|
||||
Math.abs(
|
||||
$(".suggestions").offset().top -
|
||||
try {
|
||||
let scroll =
|
||||
Math.abs(
|
||||
$(".suggestions").offset().top -
|
||||
$(".entry.activeKeyboard").offset().top -
|
||||
$(".suggestions").scrollTop()
|
||||
) -
|
||||
$(".suggestions").outerHeight() / 2 +
|
||||
$($(".entry")[0]).outerHeight();
|
||||
$(".suggestions").scrollTop(scroll);
|
||||
) -
|
||||
$(".suggestions").outerHeight() / 2 +
|
||||
$($(".entry")[0]).outerHeight();
|
||||
$(".suggestions").scrollTop(scroll);
|
||||
} catch (e) {
|
||||
console.log('could not scroll suggestions: ' + e.message);
|
||||
}
|
||||
// console.log(`scrolling to ${scroll}`);
|
||||
try {
|
||||
let list = currentCommands[currentCommands.length - 1];
|
||||
|
|
Loading…
Reference in a new issue