From 16b238124ad02cbff76a62a3de669484e3072aa6 Mon Sep 17 00:00:00 2001 From: adisposkofh Date: Mon, 20 Apr 2026 09:24:51 +0200 Subject: [PATCH] cleaned up search icon conditional render --- public/js/components/searchbar/searchbar.js | 23 +++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) 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" + ); }, }, };