fix(commandline): blur active element after closing the modal to hide balloons

closes #6320
This commit is contained in:
Miodec 2025-03-05 19:03:05 +01:00
parent 02c48fc50d
commit 25dada50eb

View file

@ -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;
},