From e551e043af7f9cbab6771e177fbeba7d9b8c632e Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 20 Mar 2024 20:56:50 +0100 Subject: [PATCH] impr: automatically refocus the test when closing the command line on the test page --- frontend/src/ts/commandline/commandline.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/ts/commandline/commandline.ts b/frontend/src/ts/commandline/commandline.ts index fb090d0a764b..7afdf27ed4bc 100644 --- a/frontend/src/ts/commandline/commandline.ts +++ b/frontend/src/ts/commandline/commandline.ts @@ -7,6 +7,8 @@ import { clearFontPreview } from "../ui"; import AnimatedModal, { ShowOptions } from "../utils/animated-modal"; import * as Notifications from "../elements/notifications"; import * as OutOfFocus from "../test/out-of-focus"; +import * as ActivePage from "../states/active-page"; +import { focusWords } from "../test/test-ui"; type CommandlineMode = "search" | "input"; type InputModeParams = { @@ -114,10 +116,16 @@ export function show( function hide(clearModalChain = false): void { clearFontPreview(); void ThemeController.clearPreview(); + if (ActivePage.get() === "test") { + focusWords(); + } void modal.hide({ clearModalChain, afterAnimation: async () => { addCommandlineBackground(); + if (ActivePage.get() === "test") { + focusWords(); + } }, }); }