diff --git a/src/floatSearchIndex.ts b/src/floatSearchIndex.ts index 20a6f51..41800d3 100644 --- a/src/floatSearchIndex.ts +++ b/src/floatSearchIndex.ts @@ -92,7 +92,7 @@ const initSearchViewWithLeaf = async (app: App, type: PaneType | 'sidebar', stat }); setTimeout(() => { - const inputEl = leaf.containerEl.getElementsByTagName("input")?.[0]; + const inputEl = leaf?.containerEl.getElementsByTagName("input")?.[0]; inputEl.focus(); }, 0); };