Triggers full text search when Ctrl + Enter is pressed

This commit is contained in:
SiriusXT 2024-11-17 12:17:11 +08:00
parent 46823d28e8
commit e091ef64dd

View File

@ -131,19 +131,6 @@ function initNoteAutocomplete($el, options) {
// this is important because otherwise input will lose focus immediately and not show the results // this is important because otherwise input will lose focus immediately and not show the results
return false; 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 = {}; let autocompleteOptions = {};
if (options.container) { if (options.container) {