diff --git a/assets/icons/search-not-found.png b/assets/icons/search-not-found.png new file mode 100644 index 000000000000..545657e2dbd8 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 7673afafe855..d41a2e2559cd 100644 --- a/assets/js/registrySearch.js +++ b/assets/js/registrySearch.js @@ -163,12 +163,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 4ed992793e72..52d5bd2b88fe 100644 --- a/layouts/shortcodes/ecosystem/registry/search-form.html +++ b/layouts/shortcodes/ecosystem/registry/search-form.html @@ -141,6 +141,20 @@ Loading results… + + + +