diff --git a/frontend/src/ts/config.ts b/frontend/src/ts/config.ts index ee4584c9a..0b1ca296b 100644 --- a/frontend/src/ts/config.ts +++ b/frontend/src/ts/config.ts @@ -1611,6 +1611,9 @@ export function setFontSize(fontSize: number, nosave?: boolean): boolean { saveToLocalStorage("fontSize", nosave); ConfigEvent.dispatch("fontSize", config.fontSize); + // trigger a resize event to update the layout - handled in ui.ts:108 + $(window).trigger("resize"); + return true; } diff --git a/frontend/src/ts/ui.ts b/frontend/src/ts/ui.ts index ee80b7e1c..f798a5e5b 100644 --- a/frontend/src/ts/ui.ts +++ b/frontend/src/ts/ui.ts @@ -84,12 +84,17 @@ window.addEventListener("beforeunload", (event) => { const debouncedEvent = debounce(250, async () => { Caret.updatePosition(); - if ( - Config.tapeMode !== "off" && - getActivePage() === "test" && - !TestUI.resultVisible - ) { - TestUI.scrollTape(); + if (getActivePage() === "test" && !TestUI.resultVisible) { + if (Config.tapeMode !== "off") { + TestUI.scrollTape(); + } else { + const currentTop: number = Math.floor( + document.querySelectorAll("#words .word")[ + TestUI.currentWordElementIndex - 1 + ].offsetTop + ); + TestUI.lineJump(currentTop); + } } setTimeout(() => { Caret.show();