Keep the dropdown hidden after search execution

This commit is contained in:
2026-05-27 09:45:22 -04:00
parent 0d3de28967
commit 586acbe9a1
+4 -1
View File
@@ -440,6 +440,7 @@
/** Populate and show the dropdown with history, title suggestions, and tag suggestions */ /** Populate and show the dropdown with history, title suggestions, and tag suggestions */
async populate(inputValue, cursorPos) { async populate(inputValue, cursorPos) {
if (this._suppressNext) { this._suppressNext = false; return; }
// Cancel previous suggestion request // Cancel previous suggestion request
if (suggestAbortController) { if (suggestAbortController) {
suggestAbortController.abort(); suggestAbortController.abort();
@@ -466,6 +467,7 @@
} }
// Show/hide sections // Show/hide sections
this._historySection.hidden = historyItems.length === 0;
this._titlesSection.hidden = true; this._titlesSection.hidden = true;
this._tagsSection.hidden = true; this._tagsSection.hidden = true;
const hasContent = historyItems.length > 0; const hasContent = historyItems.length > 0;
@@ -6093,8 +6095,9 @@
const excl = document.getElementById("search-exclude-input"); const excl = document.getElementById("search-exclude-input");
if (excl) excl.value = s.exclude_paths; if (excl) excl.value = s.exclude_paths;
} }
// Execute the search // Execute the search — suppress dropdown from appearing
AutocompleteDropdown.hide(); AutocompleteDropdown.hide();
AutocompleteDropdown._suppressNext = true;
const vault = s.vault || "all"; const vault = s.vault || "all";
if (input) { input.dispatchEvent(new Event("input")); } if (input) { input.dispatchEvent(new Event("input")); }
clearTimeout(searchTimeout); clearTimeout(searchTimeout);