diff --git a/assets/js/app.js b/assets/js/app.js index 9b5bff0..84c8f9a 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -187,7 +187,12 @@ } document.addEventListener('click', e => { - if (searchPop && searchPop.dataset.open === 'true' && !e.target.closest('.subhead')) closeSearch(); + if (searchPop && searchPop.dataset.open === 'true') { + const inSearch = e.target.closest('label[for="searchInput"]') + || e.target.id === 'searchInput' + || e.target.closest('#searchpop'); + if (!inSearch) closeSearch(); + } }); function closeSearch() { diff --git a/static/js/app.js b/static/js/app.js index 9b5bff0..84c8f9a 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -187,7 +187,12 @@ } document.addEventListener('click', e => { - if (searchPop && searchPop.dataset.open === 'true' && !e.target.closest('.subhead')) closeSearch(); + if (searchPop && searchPop.dataset.open === 'true') { + const inSearch = e.target.closest('label[for="searchInput"]') + || e.target.id === 'searchInput' + || e.target.closest('#searchpop'); + if (!inSearch) closeSearch(); + } }); function closeSearch() {