mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
impr(commandline): scroll active entry into view when searchbar is empty (JayTailor45) (#4663)
* fix: language selection scroll into view behaviour * impr: improve animation logic * impr: display selected language to center * impr: add background hover for selected language * impr: reuse existing keepActiveEntryInView function
This commit is contained in:
parent
6096b0cde1
commit
d2a6b896ee
1 changed files with 11 additions and 1 deletions
|
|
@ -218,8 +218,18 @@ function updateSuggested(): void {
|
|||
});
|
||||
}
|
||||
showFound();
|
||||
activeIndex = 0;
|
||||
|
||||
// display background hover effect for selected language
|
||||
const scrollTarget = $(".suggestions .entry .icon i.fa-check");
|
||||
const entryIndex = scrollTarget.parent().parent().attr("index");
|
||||
if (entryIndex !== undefined) {
|
||||
activeIndex = parseInt(entryIndex);
|
||||
} else {
|
||||
activeIndex = 0;
|
||||
}
|
||||
|
||||
updateActiveEntry();
|
||||
keepActiveEntryInView();
|
||||
}
|
||||
|
||||
function show(): void {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue