diff --git a/note_kfet/static/js/base.js b/note_kfet/static/js/base.js index 3863dac1..c12e3f0a 100644 --- a/note_kfet/static/js/base.js +++ b/note_kfet/static/js/base.js @@ -213,6 +213,13 @@ function autoCompleteNote (field_id, note_list_id, notes, notes_display, alias_p fallbackPlacement: 'clockwise' }); + // When the user clicks elsewhere, we hide the tooltip + $(document).click(function(e) { + if (!e.target.id.startsWith(alias_prefix)) { + field.tooltip("hide"); + } + }); + let old_pattern = null; // Clear search on click