Merge pull request #19 from depressiveRobot/patch-1

fix selection for search with last state
This commit is contained in:
Boninall 2023-05-12 21:26:49 +08:00 committed by GitHub
commit 67bd4bf8eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;