From 5650ba411aaa4f708b3a3428446b1657566cc898 Mon Sep 17 00:00:00 2001 From: sergiucoman Date: Fri, 12 Apr 2024 15:45:57 +0300 Subject: [PATCH] Ignored empty search tokens (#229) Co-authored-by: Sergiu Coman --- aemeds/blocks/blogheader/blogheader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aemeds/blocks/blogheader/blogheader.js b/aemeds/blocks/blogheader/blogheader.js index c9de93a..214dfd1 100644 --- a/aemeds/blocks/blogheader/blogheader.js +++ b/aemeds/blocks/blogheader/blogheader.js @@ -127,7 +127,7 @@ async function handleSearch(block) { searchResults.style.display = 'block'; searchResults.innerHTML = ''; - const searchTerms = searchValue.toLowerCase().split(/\s+/); + const searchTerms = searchValue.toLowerCase().split(/\s+/).filter((item) => item !== ''); const blogs = ffetch(BLOG_QUERY_INDEX) .chunks(CHUNK_SIZE) .sheet('blogs-content');