diff --git a/assets/icons/search-not-found.png b/assets/icons/search-not-found.png new file mode 100644 index 000000000000..490a264d498e Binary files /dev/null and b/assets/icons/search-not-found.png differ diff --git a/assets/js/registrySearch.js b/assets/js/registrySearch.js index d91c590585a3..f2a9eb8f1321 100644 --- a/assets/js/registrySearch.js +++ b/assets/js/registrySearch.js @@ -137,12 +137,12 @@ function executeSearch(searchQuery) { let results = miniSearch.search(searchQuery); document.getElementById('search-loading').style.display = 'none'; - if (results.length > 0) { - populateResults(results); - } else { - document.querySelector('#search-results').innerHTML += - '
No matches found
'; - } + if (results.length === 0) { + document.getElementById('no-search-result').style.display = 'block'; + } + + populateResults(results); + }, 0); }; diff --git a/layouts/shortcodes/ecosystem/registry/search-form.html b/layouts/shortcodes/ecosystem/registry/search-form.html index 4e2fc00028c1..dc8806e07f4d 100644 --- a/layouts/shortcodes/ecosystem/registry/search-form.html +++ b/layouts/shortcodes/ecosystem/registry/search-form.html @@ -97,6 +97,20 @@ Loading results… + + + +