aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiodec <[email protected]>2024-11-14 19:56:35 +0100
committerMiodec <[email protected]>2024-11-14 21:52:37 +0100
commite21a205c0a5660145abbd6f5081bee3560b1c87d (patch)
tree0f60c6ac0a7d36deb2d832c4a2335ded23b2d9ed
parent527d65702a497a4449ba0e54247b4a7ef3d05107 (diff)
downloadmonkeytype-e21a205c0a5660145abbd6f5081bee3560b1c87d.tar.gz
monkeytype-e21a205c0a5660145abbd6f5081bee3560b1c87d.zip
fix(commandline): running wrong command on mobile or when not moving the mouse
closes #6037
-rw-r--r--frontend/src/ts/commandline/commandline.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/frontend/src/ts/commandline/commandline.ts b/frontend/src/ts/commandline/commandline.ts
index acceb130b..f5305a594 100644
--- a/frontend/src/ts/commandline/commandline.ts
+++ b/frontend/src/ts/commandline/commandline.ts
@@ -430,7 +430,11 @@ async function showCommands(): Promise<void> {
await updateActiveCommand();
});
command.addEventListener("click", async () => {
+ const previous = activeIndex;
activeIndex = parseInt(command.getAttribute("data-index") ?? "0");
+ if (previous !== activeIndex) {
+ await updateActiveCommand();
+ }
await runActiveCommand();
});
}