Skip to content

Commit

Permalink
Triggers full text search when Ctrl + Enter is pressed in note_autoco…
Browse files Browse the repository at this point in the history
…mplete
  • Loading branch information
SiriusXT committed Nov 13, 2024
1 parent 693bcfb commit db79f23
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/public/app/services/note_autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ function initNoteAutocomplete($el, options) {
return false;
});

// Triggers full text search when Ctrl + Enter is pressed.
$el.on('keydown', (event) => {
if (event.key === 'Enter') {
if (event.ctrlKey) {
// Prevent Ctrl + Enter from triggering autoComplete.
event.preventDefault();
event.stopImmediatePropagation();
const searchString = $el.val();
appContext.triggerCommand('searchNotes', { searchString });
}
}
});

let autocompleteOptions = {};
if (options.container) {
autocompleteOptions.dropdownMenuContainer = options.container;
Expand Down

0 comments on commit db79f23

Please sign in to comment.