Skip to content

Commit 9a4ac30

Browse files
committed
fix(tape mode): indicate typos: below being cut off
1 parent 0750f26 commit 9a4ac30

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

frontend/src/ts/test/test-ui.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,14 @@ export function updateWordsWrapperHeight(force = false): void {
578578
//limit to 3 lines
579579
wrapperEl.style.height = wrapperHeight + "px";
580580
} else {
581-
//show 3 lines if tape mode is on and has newlines, otherwise 1
582-
const linesToShow = TestWords.hasNewline ? 3 : 1;
583-
wrapperEl.style.height = wordHeight * linesToShow + "px";
581+
//show 3 lines if tape mode is on and has newlines, otherwise use words height (because of indicate typos: below)
582+
if (TestWords.hasNewline) {
583+
wrapperEl.style.height = wordHeight * 3 + "px";
584+
} else {
585+
const wordsHeight =
586+
document.getElementById("words")?.offsetHeight ?? wordHeight;
587+
wrapperEl.style.height = wordsHeight + "px";
588+
}
584589
}
585590
}
586591

0 commit comments

Comments
 (0)