mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-11 18:04:27 +08:00
impr(test): stop on letter now supports indicate typos
The typos will now be correctly shown to the right of the caret
This commit is contained in:
parent
d2fc78b319
commit
8b95078223
2 changed files with 11 additions and 2 deletions
|
|
@ -192,6 +192,9 @@ function handleSpace(): void {
|
|||
MonkeyPower.addPower(isWordCorrect, true);
|
||||
TestInput.incrementAccuracy(isWordCorrect);
|
||||
if (isWordCorrect) {
|
||||
if (Config.indicateTypos !== "off" && Config.stopOnError === "letter") {
|
||||
TestUI.updateWordElement();
|
||||
}
|
||||
PaceCaret.handleSpace(true, currentWord);
|
||||
TestInput.input.pushHistory();
|
||||
TestWords.words.increaseCurrentIndex();
|
||||
|
|
@ -590,6 +593,9 @@ function handleChar(
|
|||
Config.stopOnError === "letter" &&
|
||||
!thisCharCorrect
|
||||
) {
|
||||
if (Config.indicateTypos !== "off") {
|
||||
TestUI.updateWordElement(undefined, TestInput.input.current + char);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -536,8 +536,11 @@ export async function screenshot(): Promise<void> {
|
|||
}, 3000);
|
||||
}
|
||||
|
||||
export function updateWordElement(showError = !Config.blindMode): void {
|
||||
const input = TestInput.input.current;
|
||||
export function updateWordElement(
|
||||
showError = !Config.blindMode,
|
||||
inputOverride?: string
|
||||
): void {
|
||||
const input = inputOverride || TestInput.input.current;
|
||||
const wordAtIndex = <Element>document.querySelector("#words .word.active");
|
||||
const currentWord = TestWords.words.getCurrent();
|
||||
if (!currentWord && Config.mode !== "zen") return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue