mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 15:49:00 +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(() => {
|
useEffect(() => {
|
||||||
if (!ref.current) return;
|
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);
|
note_autocomplete.setText($autoComplete, text);
|
||||||
} else {
|
} else {
|
||||||
ref.current.value = "";
|
ref.current.value = "";
|
||||||
}
|
}
|
||||||
}, [text]);
|
}, [text, noteId]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="input-group" style={containerStyle}>
|
<div className="input-group" style={containerStyle}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user