From 0abeb8da561e61d2fbb8b1969903bb418c46f30c Mon Sep 17 00:00:00 2001 From: lazyloong <2950449004@qq.com> Date: Thu, 7 Dec 2023 22:40:50 +0800 Subject: [PATCH] fix #28 --- manifest.json | 2 +- src/fuzzyModal.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index ffaacaa..5595d94 100644 --- a/manifest.json +++ b/manifest.json @@ -5,5 +5,5 @@ "author": "lazyloong", "minAppVersion": "1.0.0", - "version": "2.10.1" + "version": "2.10.2" } diff --git a/src/fuzzyModal.ts b/src/fuzzyModal.ts index b80e962..c8a2d6e 100644 --- a/src/fuzzyModal.ts +++ b/src/fuzzyModal.ts @@ -23,12 +23,18 @@ export default abstract class FuzzyModal extends SuggestModal { 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" }); } }); }