Skip to content

Commit

Permalink
hide results on focus
Browse files Browse the repository at this point in the history
  • Loading branch information
amareshsm committed Dec 21, 2024
1 parent 39b2664 commit 8a0566f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/assets/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@ const resultsLiveRegion = document.querySelector(
);
const searchInput = document.querySelector("#search");
const searchClearBtn = document.querySelector("#search__clear-btn");
const poweredByLink = document.querySelector(".search_powered-by-wrapper");
let activeIndex = -1;
let searchQuery;

if (poweredByLink) {
poweredByLink.addEventListener("focus", function () {
clearSearchResults();
});
}

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
Expand Down

0 comments on commit 8a0566f

Please sign in to comment.