fix(typing test): line jumping too late

This commit is contained in:
Miodec 2024-06-11 12:52:44 +02:00
parent 44ecb3671e
commit 04a64c6662

View file

@ -309,6 +309,29 @@ async function handleSpace(): Promise<void> {
TestInput.corrected.pushHistory();
if (Config.keymapMode === "react") {
void KeymapEvent.flash(" ", true);
}
if (
Config.mode === "words" ||
Config.mode === "custom" ||
Config.mode === "quote" ||
Config.mode === "zen"
) {
TimerProgress.update();
}
if (
Config.mode === "time" ||
Config.mode === "words" ||
Config.mode === "custom" ||
Config.mode === "quote"
) {
await TestLogic.addWord();
}
TestUI.setCurrentWordElementIndex(TestUI.currentWordElementIndex + 1);
TestUI.updateActiveElement();
void Caret.updatePosition();
if (
!Config.showAllLines ||
Config.mode === "time" ||
@ -345,29 +368,6 @@ async function handleSpace(): Promise<void> {
// //send a tab event using jquery
// $("#wordsInput").trigger($.Event("keydown", { key: "Tab", code: "Tab" }));
// }
if (Config.keymapMode === "react") {
void KeymapEvent.flash(" ", true);
}
if (
Config.mode === "words" ||
Config.mode === "custom" ||
Config.mode === "quote" ||
Config.mode === "zen"
) {
TimerProgress.update();
}
if (
Config.mode === "time" ||
Config.mode === "words" ||
Config.mode === "custom" ||
Config.mode === "quote"
) {
await TestLogic.addWord();
}
TestUI.setCurrentWordElementIndex(TestUI.currentWordElementIndex + 1);
TestUI.updateActiveElement();
void Caret.updatePosition();
}
function isCharCorrect(char: string, charIndex: number): boolean {