fix(react/dialogs): recent notes not triggered in autocomplete

This commit is contained in:
Elian Doran
2025-08-05 21:06:12 +03:00
parent 0cfe3351bb
commit 35bd210062
4 changed files with 23 additions and 17 deletions

View File

@@ -452,6 +452,21 @@ function init() {
};
}
/**
* Convenience function which triggers the display of recent notes in the autocomplete input and focuses it.
*
* @param inputElement - The input element to trigger recent notes on.
*/
export function triggerRecentNotes(inputElement: HTMLInputElement | null | undefined) {
if (!inputElement) {
return;
}
const $el = $(inputElement);
showRecentNotes($el);
$el.trigger("focus").trigger("select");
}
export default {
autocompleteSourceForCKEditor,
initNoteAutocomplete,