fix(react/dialogs): note autocomplete not restoring note

This commit is contained in:
Elian Doran 2025-08-10 18:01:36 +03:00
parent 3d81633214
commit b5555d94f5
No known key found for this signature in database

View File

@ -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}>