From 4d9221d7a41ea910b21d96df500c14360dd5573f Mon Sep 17 00:00:00 2001 From: Michael Schnerring <3743342+schnerring@users.noreply.github.com> Date: Fri, 15 Oct 2021 15:42:26 +0200 Subject: [PATCH] flexsearch: only display 'no results' message if search query is not empty --- assets/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/index.js b/assets/js/index.js index 24049b9..b99ab90 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -134,7 +134,7 @@ Source: suggestions.classList.remove('d-none'); // inform user that no results were found - if (flatResults.size === 0) { + if (flatResults.size === 0 && searchQuery) { const noResultsMessage = document.createElement('div') noResultsMessage.innerHTML = `No results for "${searchQuery}"` noResultsMessage.classList.add("suggestion__no-results");