mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
Triggers full text search when Ctrl + Enter is pressed in note_autocomplete
This commit is contained in:
parent
693bcfb587
commit
db79f231a0
@ -132,6 +132,19 @@ function initNoteAutocomplete($el, options) {
|
|||||||
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) {
|
||||||
autocompleteOptions.dropdownMenuContainer = options.container;
|
autocompleteOptions.dropdownMenuContainer = options.container;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user