Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(react/dialogs): note autocomplete not restoring note
Elian Doranb5555d94f5fc
diff --git a/apps/client/src/widgets/react/NoteAutocomplete.tsx b/apps/client/src/widgets/react/NoteAutocomplete.tsxindex fb5274318e..2fd250c765 100644--- a/apps/client/src/widgets/react/NoteAutocomplete.tsx+++ b/apps/client/src/widgets/react/NoteAutocomplete.tsx@@ -60,13 +60,16 @@ export default function NoteAutocomplete({ inputRef: _ref, text, placeholder, onuseEffect(() => {if (!ref.current) return;- if (text) {- const $autoComplete = $(ref.current);+ const $autoComplete = $(ref.current);++ if (noteId) {+ $autoComplete.setNote(noteId);+ } else if (text) {note_autocomplete.setText($autoComplete, text);} else {ref.current.value = "";}- }, [text]);+ }, [text, noteId]);return (<div className="input-group" style={containerStyle}>