mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-20 15:26:15 +08:00
fix: backspace to previous word in stop on letter leaving type hints (NadAlaba) (#5466)
* fix: fix backspace to previous word in stop on letter (NadAlaba) * revert to calling updateWordElement() in all cases after backspacing
This commit is contained in:
parent
37c256b037
commit
a1c805cc28
|
@ -120,13 +120,12 @@ function backspaceToPrevious(): void {
|
|||
return;
|
||||
}
|
||||
|
||||
const wordElements = document.querySelectorAll("#words > .word");
|
||||
if (
|
||||
(TestInput.input.history[TestWords.words.currentIndex - 1] ==
|
||||
TestWords.words.get(TestWords.words.currentIndex - 1) &&
|
||||
!Config.freedomMode) ||
|
||||
$($(".word")[TestWords.words.currentIndex - 1] as HTMLElement).hasClass(
|
||||
"hidden"
|
||||
)
|
||||
wordElements[TestWords.words.currentIndex - 1]?.classList.contains("hidden")
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
@ -135,6 +134,14 @@ function backspaceToPrevious(): void {
|
|||
return;
|
||||
}
|
||||
|
||||
const incorrectLetterBackspaced =
|
||||
wordElements[TestWords.words.currentIndex]?.children[0]?.classList.contains(
|
||||
"incorrect"
|
||||
);
|
||||
if (Config.stopOnError === "letter" && incorrectLetterBackspaced) {
|
||||
void TestUI.updateWordElement();
|
||||
}
|
||||
|
||||
TestInput.input.current = TestInput.input.popHistory();
|
||||
TestInput.corrected.popHistory();
|
||||
if (
|
||||
|
|
Loading…
Reference in a new issue