diff --git a/public/js/components/searchbar/searchbar.js b/public/js/components/searchbar/searchbar.js index 672e99da9..2abeaf507 100644 --- a/public/js/components/searchbar/searchbar.js +++ b/public/js/components/searchbar/searchbar.js @@ -96,7 +96,6 @@ export default { > { + this.isSearchShownInMobileView = true; + }); + document + .getElementById("header-searchbar-collapsible") + .addEventListener("hidden.bs.collapse", (e) => { + this.isSearchShownInMobileView = false; + }); }, updated() { if (this.showresult) { @@ -499,12 +509,13 @@ export default { } return this.searchoptions.actions[res.type]; }, - toggleIsSearchShownInMobileView() { - this.isSearchShownInMobileView = !this.isSearchShownInMobileView; - }, getMaxWidthOfSearchbarInMobileView() { - // body width - hardcoded chevron width; necessary for accurate width transition - return (document.querySelector("body").getBoundingClientRect().width - 27) + "px"; + // body width - hardcoded chevron width; necessary for accurate collapse transition transition + return ( + document.querySelector("body").getBoundingClientRect().width - + 27 + + "px" + ); }, }, };