mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-25 07:17:23 +08:00
revert(comandline): debouncing input
it makes searching feel unresponsive
This commit is contained in:
parent
7c3d9893e2
commit
05a9b555d9
1 changed files with 14 additions and 18 deletions
|
|
@ -571,23 +571,6 @@ async function decrementActiveIndex(): Promise<void> {
|
|||
await updateActiveCommand();
|
||||
}
|
||||
|
||||
const debouncedInputHandler = debounce(100, async (e) => {
|
||||
inputValue = (e.target as HTMLInputElement).value;
|
||||
if (subgroupOverride === null) {
|
||||
if (Config.singleListCommandLine === "on") {
|
||||
usingSingleList = true;
|
||||
} else {
|
||||
usingSingleList = inputValue.startsWith(">");
|
||||
}
|
||||
}
|
||||
if (mode !== "search") return;
|
||||
mouseMode = false;
|
||||
activeIndex = 0;
|
||||
await filterSubgroup();
|
||||
await showCommands();
|
||||
await updateActiveCommand();
|
||||
});
|
||||
|
||||
const modal = new AnimatedModal({
|
||||
dialogId: "commandLine",
|
||||
customEscapeHandler: (): void => {
|
||||
|
|
@ -603,7 +586,20 @@ const modal = new AnimatedModal({
|
|||
const input = modalEl.querySelector("input") as HTMLInputElement;
|
||||
|
||||
input.addEventListener("input", async (e) => {
|
||||
void debouncedInputHandler(e);
|
||||
inputValue = (e.target as HTMLInputElement).value;
|
||||
if (subgroupOverride === null) {
|
||||
if (Config.singleListCommandLine === "on") {
|
||||
usingSingleList = true;
|
||||
} else {
|
||||
usingSingleList = inputValue.startsWith(">");
|
||||
}
|
||||
}
|
||||
if (mode !== "search") return;
|
||||
mouseMode = false;
|
||||
activeIndex = 0;
|
||||
await filterSubgroup();
|
||||
await showCommands();
|
||||
await updateActiveCommand();
|
||||
});
|
||||
|
||||
input.addEventListener("keydown", async (e) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue