mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 07:08:55 +02:00
fix(react/dialogs): note autocomplete not restoring note
This commit is contained in:
parent
3d81633214
commit
b5555d94f5
@ -60,13 +60,16 @@ export default function NoteAutocomplete({ inputRef: _ref, text, placeholder, on
|
||||
|
||||
useEffect(() => {
|
||||
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}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user