Skip to content

Commit

Permalink
PNI - Closing the search bar on mobile should also clear search (#12746)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmavis authored Aug 29, 2024
1 parent 6d1497f commit 76bafa9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ export default () => {
if (burger && burger.classList.contains("menu-open")) {
document.querySelector(".burger").click();
}

// if the search bar is open, clear the search bar
if (!searchContainer.classList.contains("tw-hidden")) {
searchContainer.querySelector(`.clear-icon`).click();
}

searchContainer.classList.toggle("tw-hidden");
mobileCatNav.classList.toggle("tw-hidden");
});
Expand Down

0 comments on commit 76bafa9

Please sign in to comment.