mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 08:55:37 +08:00
fix: zen mode not working
This commit is contained in:
parent
966d3ce574
commit
1462d5193b
2 changed files with 5 additions and 5 deletions
|
@ -116,8 +116,8 @@ export async function updatePosition(noAnim = false): Promise<void> {
|
|||
);
|
||||
|
||||
const letterPosTop =
|
||||
currentLetter?.offsetTop ||
|
||||
previousLetter?.offsetTop ||
|
||||
currentLetter?.offsetTop ??
|
||||
previousLetter?.offsetTop ??
|
||||
lastWordLetter?.offsetTop;
|
||||
|
||||
const letterHeight =
|
||||
|
@ -127,8 +127,8 @@ export async function updatePosition(noAnim = false): Promise<void> {
|
|||
Config.fontSize * Numbers.convertRemToPixels(1);
|
||||
|
||||
const letterWidth =
|
||||
currentLetter?.offsetWidth ||
|
||||
previousLetter?.offsetWidth ||
|
||||
currentLetter?.offsetWidth ??
|
||||
previousLetter?.offsetWidth ??
|
||||
lastWordLetter?.offsetWidth;
|
||||
|
||||
const diff = letterHeight - caret.offsetHeight;
|
||||
|
|
|
@ -242,7 +242,7 @@ export function updateActiveElement(
|
|||
}
|
||||
if (Config.mode === "zen" && backspace) {
|
||||
active?.remove();
|
||||
} else if (active !== null) {
|
||||
} else if (active !== null && !initial) {
|
||||
active.classList.remove("active");
|
||||
}
|
||||
const activeWord =
|
||||
|
|
Loading…
Reference in a new issue