Skip to content

Commit 5526088

Browse files
committed
fix: caret disappearing when changing font size through commandline
1 parent c17abc9 commit 5526088

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

frontend/src/ts/test/test-ui.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ export function reset(): void {
135135
currentTestLine = 0;
136136
}
137137

138-
export function focusWords(): void {
138+
export function focusWords(force = false): void {
139139
const wordsInput = document.querySelector<HTMLElement>("#wordsInput");
140-
wordsInput?.blur();
140+
if (force) {
141+
wordsInput?.blur();
142+
}
141143
wordsInput?.focus({
142144
preventScroll: true,
143145
});

frontend/src/ts/ui.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ const debouncedEvent = debounce(250, () => {
108108
setTimeout(() => {
109109
TestUI.updateWordsInputPosition();
110110
TestUI.focusWords();
111+
Caret.show();
111112
}, 250);
112113
}
113114
});

frontend/src/ts/utils/caret.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export class Caret {
6262

6363
public show(): void {
6464
this.element.classList.remove("hidden");
65+
this.element.style.display = "";
6566
}
6667

6768
public hide(): void {

0 commit comments

Comments
 (0)