fix: caret disappearing when changing font size through commandline

This commit is contained in:
Miodec 2025-10-17 16:42:30 +02:00
parent c17abc9dc0
commit 5526088142
3 changed files with 6 additions and 2 deletions

View file

@ -135,9 +135,11 @@ export function reset(): void {
currentTestLine = 0;
}
export function focusWords(): void {
export function focusWords(force = false): void {
const wordsInput = document.querySelector<HTMLElement>("#wordsInput");
wordsInput?.blur();
if (force) {
wordsInput?.blur();
}
wordsInput?.focus({
preventScroll: true,
});

View file

@ -108,6 +108,7 @@ const debouncedEvent = debounce(250, () => {
setTimeout(() => {
TestUI.updateWordsInputPosition();
TestUI.focusWords();
Caret.show();
}, 250);
}
});

View file

@ -62,6 +62,7 @@ export class Caret {
public show(): void {
this.element.classList.remove("hidden");
this.element.style.display = "";
}
public hide(): void {