From 76664fc7ae778a58bf803a8558dc71e2279d6941 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 28 Dec 2021 21:26:17 +0100 Subject: [PATCH] cleaned up the animations when not using quick tab and show out of focus warning is enabled. also closes #2206 --- src/js/input-controller.js | 2 +- src/js/test/test-logic.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/input-controller.js b/src/js/input-controller.js index f6532789f..bbc3b5de6 100644 --- a/src/js/input-controller.js +++ b/src/js/input-controller.js @@ -667,7 +667,7 @@ $(document).keydown((event) => { !TestUI.resultVisible && (wordsFocused || event.key !== "Enter"); - if (allowTyping && !wordsFocused && !$("#restartTestButton").is(":focus")) { + if (allowTyping && !wordsFocused && event.key !== "Enter") { TestUI.focusWords(); if (Config.showOutOfFocusWarning) { event.preventDefault(); diff --git a/src/js/test/test-logic.js b/src/js/test/test-logic.js index 3b6aade1d..c11c7cca6 100644 --- a/src/js/test/test-logic.js +++ b/src/js/test/test-logic.js @@ -555,7 +555,7 @@ export function restart( setBailout(false); PaceCaret.reset(); $("#showWordHistoryButton").removeClass("loaded"); - TestUI.focusWords(); + $("#restartTestButton").blur(); Funbox.resetMemoryTimer(); RateQuotePopup.clearQuoteStats(); $("#wordsInput").val(" "); @@ -589,6 +589,7 @@ export function restart( }, 125, async () => { + TestUI.focusWords(); $("#monkey .fast").stop(true, true).css("opacity", 0); $("#monkey").stop(true, true).css({ animationDuration: "0s" }); $("#typingTest").css("opacity", 0).removeClass("hidden");