Skip to content

Commit 527d657

Browse files
committed
fix: balloon message clipping on the result page
closes monkeytypegame#6016
1 parent 05d88af commit 527d657

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

frontend/src/html/pages/test.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
<div class="top">characters</div>
243243
<div
244244
class="bottom"
245-
aria-label="correct, incorrect, extra, and missed"
245+
aria-label="correct&NewLine;incorrect&NewLine;extra&NewLine;missed"
246246
data-balloon-break=""
247247
data-balloon-pos="up"
248248
>

frontend/src/ts/test/result.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ function updateWpmAndAcc(): void {
268268

269269
$("#result .stats .acc .bottom").attr(
270270
"aria-label",
271-
`${TestInput.accuracy.correct} correct / ${TestInput.accuracy.incorrect} incorrect`
271+
`${TestInput.accuracy.correct} correct\n${TestInput.accuracy.incorrect} incorrect`
272272
);
273273
} else {
274274
//not showing decimal places
@@ -287,16 +287,18 @@ function updateWpmAndAcc(): void {
287287
$("#result .stats .wpm .bottom").attr("aria-label", wpmHover);
288288
$("#result .stats .raw .bottom").attr("aria-label", rawWpmHover);
289289

290-
$("#result .stats .acc .bottom").attr(
291-
"aria-label",
292-
`${
293-
result.acc === 100
294-
? "100"
295-
: Format.percentage(result.acc, { showDecimalPlaces: true })
296-
} (${TestInput.accuracy.correct} correct / ${
297-
TestInput.accuracy.incorrect
298-
} incorrect)`
299-
);
290+
$("#result .stats .acc .bottom")
291+
.attr(
292+
"aria-label",
293+
`${
294+
result.acc === 100
295+
? "100%"
296+
: Format.percentage(result.acc, { showDecimalPlaces: true })
297+
}\n${TestInput.accuracy.correct} correct\n${
298+
TestInput.accuracy.incorrect
299+
} incorrect`
300+
)
301+
.attr("data-balloon-break", "");
300302
}
301303
}
302304

0 commit comments

Comments
 (0)