mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-26 18:09:40 +08:00
fix: tape mode sometimes showing two cut off lines (for real this time)
This commit is contained in:
parent
6657c02d7d
commit
46fa970086
1 changed files with 14 additions and 10 deletions
|
|
@ -552,9 +552,7 @@ function updateWordsHeight(force = false): void {
|
|||
finalWrapperHeight = wrapperHeight;
|
||||
}
|
||||
|
||||
$("#words")
|
||||
.css("height", finalWordsHeight + "px")
|
||||
.css("overflow", "hidden");
|
||||
$("#words").css("height", "0px");
|
||||
|
||||
if (Config.tapeMode !== "off") {
|
||||
$("#words").width("200vw");
|
||||
|
|
@ -563,13 +561,18 @@ function updateWordsHeight(force = false): void {
|
|||
$("#words").css({ marginLeft: "unset", width: "" });
|
||||
}
|
||||
|
||||
$("#wordsWrapper")
|
||||
.css("height", finalWrapperHeight + "px")
|
||||
.css("overflow", "hidden");
|
||||
$(".outOfFocusWarning").css(
|
||||
"margin-top",
|
||||
finalWrapperHeight / 2 - Numbers.convertRemToPixels(1) / 2 + "px"
|
||||
);
|
||||
setTimeout(() => {
|
||||
$("#wordsWrapper")
|
||||
.css("height", finalWrapperHeight + "px")
|
||||
.css("overflow", "hidden");
|
||||
$("#words")
|
||||
.css("height", finalWordsHeight + "px")
|
||||
.css("overflow", "hidden");
|
||||
$(".outOfFocusWarning").css(
|
||||
"margin-top",
|
||||
finalWrapperHeight / 2 - Numbers.convertRemToPixels(1) / 2 + "px"
|
||||
);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
if (Config.mode === "zen") {
|
||||
|
|
@ -918,6 +921,7 @@ export async function updateWordElement(inputOverride?: string): Promise<void> {
|
|||
}
|
||||
|
||||
export function scrollTape(): void {
|
||||
if (ActivePage.get() !== "test" || resultVisible) return;
|
||||
const wordsWrapperWidth = (
|
||||
document.querySelector("#wordsWrapper") as HTMLElement
|
||||
).offsetWidth;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue