From f36594efb7621f0a1667c01785d3299e9fa00312 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Wed, 27 Nov 2024 10:10:37 +0800 Subject: [PATCH] Add full text search in autocomplete results --- src/public/app/services/note_autocomplete.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/public/app/services/note_autocomplete.js b/src/public/app/services/note_autocomplete.js index 9dd1501f5..6770a3899 100644 --- a/src/public/app/services/note_autocomplete.js +++ b/src/public/app/services/note_autocomplete.js @@ -115,12 +115,13 @@ function fullTextSearch($el, options){ const searchString = $el.autocomplete('val'); if (options.fastSearch === false || searchString.trim().length === 0) { return; - } + } + $el.trigger('focus'); options.fastSearch = false; $el.autocomplete('val', ''); $el.setSelectedNotePath(""); $el.autocomplete('val', searchString); - $el.trigger('focus'); + // Set a delay to avoid resetting to true before the full text search is completed. setTimeout(() => { options.fastSearch = true; }, 100); }