From e9229e48b09361d61a391d81468d93c93cbdeee1 Mon Sep 17 00:00:00 2001 From: Marvin Frommhold Date: Fri, 12 May 2023 13:55:12 +0200 Subject: [PATCH] fix selection for search with last state --- src/floatSearchIndex.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/floatSearchIndex.ts b/src/floatSearchIndex.ts index 7ab178a..da59000 100644 --- a/src/floatSearchIndex.ts +++ b/src/floatSearchIndex.ts @@ -468,7 +468,7 @@ class FloatSearchModal extends Modal { setTimeout(async ()=>{ await this.searchLeaf.view.setState(this.state, true); - this.state?.current ? (this.searchLeaf.view as SearchView).searchComponent.inputEl.setSelectionRange(0, 0) : (this.searchLeaf.view as SearchView).searchComponent.inputEl.setSelectionRange(this.state?.query?.length, this.state?.query?.length); + this.state?.current ? (this.searchLeaf.view as SearchView).searchComponent.inputEl.setSelectionRange(0, 0) : (this.searchLeaf.view as SearchView).searchComponent.inputEl.setSelectionRange(0, this.state?.query?.length); }, 0); return;