mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-08 16:34:45 +08:00
fix: caret disappearing when changing font size through commandline
This commit is contained in:
parent
c17abc9dc0
commit
5526088142
3 changed files with 6 additions and 2 deletions
|
|
@ -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,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ const debouncedEvent = debounce(250, () => {
|
|||
setTimeout(() => {
|
||||
TestUI.updateWordsInputPosition();
|
||||
TestUI.focusWords();
|
||||
Caret.show();
|
||||
}, 250);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ export class Caret {
|
|||
|
||||
public show(): void {
|
||||
this.element.classList.remove("hidden");
|
||||
this.element.style.display = "";
|
||||
}
|
||||
|
||||
public hide(): void {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue