Skip to content

Commit

Permalink
impr: automatically refocus the test when closing the command line on…
Browse files Browse the repository at this point in the history
… the test page
  • Loading branch information
Miodec committed Mar 20, 2024
1 parent 57d9fc3 commit e551e04
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/ts/commandline/commandline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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();
}
},
});
}
Expand Down

0 comments on commit e551e04

Please sign in to comment.