From 25dada50ebdbd83b2c4e2afd9b09fe7c4b9427a9 Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 5 Mar 2025 19:03:05 +0100 Subject: [PATCH] fix(commandline): blur active element after closing the modal to hide balloons closes #6320 --- frontend/src/ts/commandline/commandline.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/ts/commandline/commandline.ts b/frontend/src/ts/commandline/commandline.ts index f5305a594..ec27b45a5 100644 --- a/frontend/src/ts/commandline/commandline.ts +++ b/frontend/src/ts/commandline/commandline.ts @@ -130,9 +130,13 @@ function hide(clearModalChain = false): void { clearModalChain, afterAnimation: async () => { addCommandlineBackground(); - const isWordsFocused = $("#wordsInput").is(":focus"); - if (ActivePage.get() === "test" && !isWordsFocused) { - focusWords(); + if (ActivePage.get() === "test") { + const isWordsFocused = $("#wordsInput").is(":focus"); + if (ActivePage.get() === "test" && !isWordsFocused) { + focusWords(); + } + } else { + (document.activeElement as HTMLElement | undefined)?.blur(); } isAnimating = false; },