Skip to content

Build your personal knowledge base with Trilium Notes

fix(empty): open note in the correct split pane

SiriusXT210dcfb98969
diff --git a/apps/client/src/widgets/type_widgets/Empty.tsx b/apps/client/src/widgets/type_widgets/Empty.tsx
index eb0f0c5eeb..013f931fc2 100644
--- a/apps/client/src/widgets/type_widgets/Empty.tsx
+++ b/apps/client/src/widgets/type_widgets/Empty.tsx
@@ -45,10 +45,10 @@ function NoteSearch() {
if (!suggestion?.notePath) {
return false;
}
-
- const activeContext = appContext.tabManager.getActiveContext();
- if (activeContext) {
- activeContext.setNote(suggestion.notePath);
+ const ntxId = autocompleteRef.current?.closest(".note-split")?.getAttribute("data-ntx-id") ?? null;
+ const activeNoteContext = appContext.tabManager.getNoteContextById(ntxId) ?? appContext.tabManager.getActiveContext();
+ if (activeNoteContext) {
+ activeNoteContext.setNote(suggestion.notePath);
}
}}
/>