mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-12 23:20:25 +08:00
scrolling to top when showing result
This commit is contained in:
parent
fd283a1839
commit
f244ad85d7
1 changed files with 5 additions and 1 deletions
|
@ -2402,7 +2402,10 @@ export async function finish(difficultyFailed = false) {
|
|||
`Test Completed: ${stats.wpm} wpm ${stats.acc}% acc ${stats.wpmRaw} raw ${consistency}% consistency`
|
||||
);
|
||||
}
|
||||
|
||||
if (window.scrollY > 0)
|
||||
$([document.documentElement, document.body])
|
||||
.stop()
|
||||
.animate({ scrollTop: 0 }, 250);
|
||||
UI.swapElements(
|
||||
$("#typingTest"),
|
||||
$("#result"),
|
||||
|
@ -2416,6 +2419,7 @@ export async function finish(difficultyFailed = false) {
|
|||
TestUI.applyBurstHeatmap();
|
||||
}
|
||||
$("#result").focus();
|
||||
window.scrollTo({ top: 0 });
|
||||
$("#testModesNotice").addClass("hidden");
|
||||
},
|
||||
() => {
|
||||
|
|
Loading…
Reference in a new issue