mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-02 03:25:22 +08:00
fix(blind mode): tape mode still scrolling when making mistakes
closes #5635
This commit is contained in:
parent
e7afa12632
commit
799902949b
1 changed files with 7 additions and 7 deletions
|
@ -944,14 +944,14 @@ export function scrollTape(): void {
|
|||
let currentWordWidth = 0;
|
||||
if (Config.tapeMode === "letter") {
|
||||
if (TestInput.input.current.length > 0) {
|
||||
const words = document.querySelectorAll("#words .word");
|
||||
const letters =
|
||||
words[currentWordElementIndex]?.querySelectorAll("letter");
|
||||
if (!letters) return;
|
||||
for (let i = 0; i < TestInput.input.current.length; i++) {
|
||||
const words = document.querySelectorAll("#words .word");
|
||||
currentWordWidth +=
|
||||
$(
|
||||
words[currentWordElementIndex]?.querySelectorAll("letter")[
|
||||
i
|
||||
] as HTMLElement
|
||||
).outerWidth(true) ?? 0;
|
||||
const letter = letters[i] as HTMLElement;
|
||||
if (letter.classList.contains("extra")) return;
|
||||
currentWordWidth += $(letter).outerWidth(true) ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue