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

This commit is contained in:
SiriusXT 2025-11-28 19:38:52 +08:00
parent f7c0e56cec
commit 210dcfb989

View File

@ -45,10 +45,10 @@ function NoteSearch() {
if (!suggestion?.notePath) { if (!suggestion?.notePath) {
return false; return false;
} }
const ntxId = autocompleteRef.current?.closest(".note-split")?.getAttribute("data-ntx-id") ?? null;
const activeContext = appContext.tabManager.getActiveContext(); const activeNoteContext = appContext.tabManager.getNoteContextById(ntxId) ?? appContext.tabManager.getActiveContext();
if (activeContext) { if (activeNoteContext) {
activeContext.setNote(suggestion.notePath); activeNoteContext.setNote(suggestion.notePath);
} }
}} }}
/> />