Skip to content

Commit 25dada5

Browse files
committed
fix(commandline): blur active element after closing the modal to hide balloons
closes monkeytypegame#6320
1 parent 02c48fc commit 25dada5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

frontend/src/ts/commandline/commandline.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,13 @@ function hide(clearModalChain = false): void {
130130
clearModalChain,
131131
afterAnimation: async () => {
132132
addCommandlineBackground();
133-
const isWordsFocused = $("#wordsInput").is(":focus");
134-
if (ActivePage.get() === "test" && !isWordsFocused) {
135-
focusWords();
133+
if (ActivePage.get() === "test") {
134+
const isWordsFocused = $("#wordsInput").is(":focus");
135+
if (ActivePage.get() === "test" && !isWordsFocused) {
136+
focusWords();
137+
}
138+
} else {
139+
(document.activeElement as HTMLElement | undefined)?.blur();
136140
}
137141
isAnimating = false;
138142
},

0 commit comments

Comments
 (0)