Skip to content

Commit

Permalink
fix(prompt): use keyboard event instead of chooser for moving
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Aug 20, 2024
1 parent 483605e commit 7ef094c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/commands/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@ export class JumpModal<T> extends FuzzySuggestModal<string> {
});

// navigate up/down with Tab and Shift+Tab
this.scope.register([], "Tab", (evt: KeyboardEvent): void => {
if (evt.isComposing || !this.chooser) return;
this.chooser.moveDown(1);
});
this.scope.register(["Shift"], "Tab", (evt: KeyboardEvent): void => {
if (evt.isComposing || !this.chooser) return;
this.chooser.moveUp(1);
});
this.scope.register([], "Tab", (): void => {
document.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowDown" }));
});
this.scope.register(["Shift"], "Tab", (): void => {
document.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowUp" }));
});
instructions.concat([{
command: "↹ ",
purpose: "Down",
Expand Down

0 comments on commit 7ef094c

Please sign in to comment.