mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	Triggers full text search when Ctrl + Enter is pressed in note_autocomplete
This commit is contained in:
		| @@ -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; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user