fix(tape mode): indicate typos: below being cut off

This commit is contained in:
Miodec 2025-04-14 13:39:10 +02:00
parent 0750f26a99
commit 9a4ac30957

View file

@ -578,9 +578,14 @@ export function updateWordsWrapperHeight(force = false): void {
//limit to 3 lines
wrapperEl.style.height = wrapperHeight + "px";
} else {
//show 3 lines if tape mode is on and has newlines, otherwise 1
const linesToShow = TestWords.hasNewline ? 3 : 1;
wrapperEl.style.height = wordHeight * linesToShow + "px";
//show 3 lines if tape mode is on and has newlines, otherwise use words height (because of indicate typos: below)
if (TestWords.hasNewline) {
wrapperEl.style.height = wordHeight * 3 + "px";
} else {
const wordsHeight =
document.getElementById("words")?.offsetHeight ?? wordHeight;
wrapperEl.style.height = wordsHeight + "px";
}
}
}