Skip to content

Commit

Permalink
fix #28
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyloong committed Dec 7, 2023
1 parent a889541 commit 0abeb8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"author": "lazyloong",

"minAppVersion": "1.0.0",
"version": "2.10.1"
"version": "2.10.2"
}
6 changes: 6 additions & 0 deletions src/fuzzyModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@ export default abstract class FuzzyModal<T extends Item> extends SuggestModal<Ma
if (this.chooser.selectedItem != this.chooser.values.length - 1) {
this.chooser.setSelectedItem(this.chooser.selectedItem + 1);
this.chooser.suggestions[this.chooser.selectedItem].scrollIntoView({ block: "center", behavior: "smooth" });
} else {
this.chooser.setSelectedItem(0);
this.chooser.suggestions[this.chooser.selectedItem].scrollIntoView({ block: "center", behavior: "smooth" });
}
});
this.scope.register(["Mod"], "P", async (e) => {
if (this.chooser.selectedItem != 0) {
this.chooser.setSelectedItem(this.chooser.selectedItem - 1);
this.chooser.suggestions[this.chooser.selectedItem].scrollIntoView({ block: "center", behavior: "smooth" });
} else {
this.chooser.setSelectedItem(this.chooser.values.length - 1);
this.chooser.suggestions[this.chooser.selectedItem].scrollIntoView({ block: "center", behavior: "smooth" });
}
});
}
Expand Down

0 comments on commit 0abeb8d

Please sign in to comment.