Hi,
As the search bar and the header overlap when searching, i want to hide the header when the search bar is opened. I have tried doing that using javascript but I cant seem to get it to work. Can someone help me get this done?
document.addEventListener('DOMContentLoaded', function () {
const header = document.querySelector('header');
const searchModal = document.querySelector('details-modal.header__search details');
if (searchModal && header) {
searchModal.addEventListener('toggle', function () {
if (searchModal.hasAttribute('open')) {
header.style.display = 'none';
} else {
header.style.display = '';
}
});
}
});
I tried this code but both the header and the search bar are disappearing when the search icon is clicked.
URL: shbqa.com
![]()

