mirror of
https://github.com/quorafind/Obsidian-Float-Search.git
synced 2026-07-22 07:30:25 +00:00
fix: cannot focus on search bar after init
This commit is contained in:
parent
dc5d25f2b7
commit
4467c23332
4 changed files with 9 additions and 5 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "float-search",
|
||||
"name": "Floating Search",
|
||||
"version": "3.4.6",
|
||||
"version": "3.4.7",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "You can use search view in modal/leaf/popout window now.",
|
||||
"author": "Boninall",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "float-search",
|
||||
"version": "3.4.6",
|
||||
"version": "3.4.7",
|
||||
"description": "You can use search view in modal/leaf/popout window now.",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -81,8 +81,6 @@ const initSearchViewWithLeaf = async (app: App, type: PaneType | 'sidebar', stat
|
|||
state: state
|
||||
});
|
||||
|
||||
console.log(leaf.view);
|
||||
|
||||
setTimeout(() => {
|
||||
const inputEl = leaf.containerEl.getElementsByTagName("input")[0];
|
||||
inputEl.focus();
|
||||
|
|
@ -503,6 +501,11 @@ export default class FloatSearchPlugin extends Plugin {
|
|||
console.log(isExistingLeaf);
|
||||
if (isExistingLeaf) {
|
||||
this.app.workspace.revealLeaf(isExistingLeaf);
|
||||
isExistingLeaf.setViewState({
|
||||
type: "search",
|
||||
active: true,
|
||||
state: this.state
|
||||
});
|
||||
return;
|
||||
}
|
||||
await initSearchViewWithLeaf(this.app, type);
|
||||
|
|
|
|||
|
|
@ -23,5 +23,6 @@
|
|||
"3.4.3": "0.15.0",
|
||||
"3.4.4": "0.15.0",
|
||||
"3.4.5": "0.15.0",
|
||||
"3.4.6": "0.15.0"
|
||||
"3.4.6": "0.15.0",
|
||||
"3.4.7": "0.15.0"
|
||||
}
|
||||
Loading…
Reference in a new issue