Merge branch 'sirius_patch_2' of https://github.com/TriliumNext/Notes into sirius_patch_2

This commit is contained in:
SiriusXT 2024-11-17 12:14:55 +08:00
commit 616d7117db

View File

@ -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;