flexsearch: only display 'no results' message if search query is not empty

This commit is contained in:
Michael Schnerring 2021-10-15 15:42:26 +02:00
parent af6c51f6f2
commit 4d9221d7a4
1 changed files with 1 additions and 1 deletions

View File

@ -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 "<strong>${searchQuery}</strong>"`
noResultsMessage.classList.add("suggestion__no-results");