mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
impr: automatically refocus the test when closing the command line on the test page
This commit is contained in:
parent
57d9fc3b04
commit
e551e043af
1 changed files with 8 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue