Skip to content

Commit

Permalink
flexsearch: only display 'no results' message if search query is not …
Browse files Browse the repository at this point in the history
…empty
  • Loading branch information
schnerring committed Oct 15, 2021
1 parent af6c51f commit 4d9221d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 4d9221d

Please sign in to comment.