aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiodec <[email protected]>2024-11-25 12:53:12 +0100
committerMiodec <[email protected]>2024-11-25 12:53:20 +0100
commitedf71da1c37d0bf77add75e845f21a42c51a4253 (patch)
treedcbf770babc84ebe9d348a3af679bef2e257eed9
parenta5c9433c3bb007582c625f4ab98f62fa6db134ea (diff)
downloadmonkeytype-edf71da1c37d0bf77add75e845f21a42c51a4253.tar.gz
monkeytype-edf71da1c37d0bf77add75e845f21a42c51a4253.zip
fix: custom mode limit breaking show all lines in some cases
#6072
-rw-r--r--frontend/src/ts/test/test-ui.ts18
1 files changed, 12 insertions, 6 deletions
diff --git a/frontend/src/ts/test/test-ui.ts b/frontend/src/ts/test/test-ui.ts
index ec28d660a..25a0f9ee0 100644
--- a/frontend/src/ts/test/test-ui.ts
+++ b/frontend/src/ts/test/test-ui.ts
@@ -497,12 +497,18 @@ function updateWordsHeight(force = false): void {
const wordsHeight = $(
document.querySelector("#words") as Element
).outerHeight(true) as number;
- if (
- Config.showAllLines &&
- Config.mode !== "time" &&
- CustomText.getLimitMode() !== "time" &&
- CustomText.getLimitValue() !== 0
- ) {
+
+ const shouldLimitToThreeLines =
+ Config.mode === "time" ||
+ (Config.mode === "custom" && CustomText.getLimitMode() === "time") ||
+ (Config.mode === "custom" &&
+ CustomText.getLimitMode() === "word" &&
+ CustomText.getLimitValue() === 0) ||
+ (Config.mode === "custom" &&
+ CustomText.getLimitMode() === "section" &&
+ CustomText.getLimitValue() === 0);
+
+ if (Config.showAllLines && !shouldLimitToThreeLines) {
// overflow-x should not be visible in tape mode, but since showAllLines can't
// be enabled simultaneously with tape mode we don't need to check it's off
$("#words")