summaryrefslogtreecommitdiffstats
path: root/assets/js/search.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/search.js')
-rw-r--r--assets/js/search.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/assets/js/search.js b/assets/js/search.js
index bfb91c8..7fd4d52 100644
--- a/assets/js/search.js
+++ b/assets/js/search.js
@@ -44,7 +44,6 @@ function handleSearchQuery(event) {
const query = document.getElementById('search').value.trim().toLowerCase();
if (!query) {
- displayErrorMessage(i18n.enterTerm);
hideSearchResults();
return;
}
@@ -306,4 +305,9 @@ document.addEventListener('DOMContentLoaded', function () {
});
searchInput.addEventListener('keyup', (e) => handleSearchQuery(e));
+ searchInput.addEventListener('input', (e) => {
+ if (!e.currentTarget.value) {
+ hideSearchResults();
+ }
+ });
});