Skip to content

Commit

Permalink
fix: balloon message clipping on the result page
Browse files Browse the repository at this point in the history
closes #6016
  • Loading branch information
Miodec committed Nov 14, 2024
1 parent 05d88af commit 527d657
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion frontend/src/html/pages/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
<div class="top">characters</div>
<div
class="bottom"
aria-label="correct, incorrect, extra, and missed"
aria-label="correct&NewLine;incorrect&NewLine;extra&NewLine;missed"
data-balloon-break=""
data-balloon-pos="up"
>
Expand Down
24 changes: 13 additions & 11 deletions frontend/src/ts/test/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function updateWpmAndAcc(): void {

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

$("#result .stats .acc .bottom").attr(
"aria-label",
`${
result.acc === 100
? "100"
: Format.percentage(result.acc, { showDecimalPlaces: true })
} (${TestInput.accuracy.correct} correct / ${
TestInput.accuracy.incorrect
} incorrect)`
);
$("#result .stats .acc .bottom")
.attr(
"aria-label",
`${
result.acc === 100
? "100%"
: Format.percentage(result.acc, { showDecimalPlaces: true })
}\n${TestInput.accuracy.correct} correct\n${
TestInput.accuracy.incorrect
} incorrect`
)
.attr("data-balloon-break", "");
}
}

Expand Down

0 comments on commit 527d657

Please sign in to comment.