diff options
Diffstat (limited to 'static/js/fixedsearch.ts')
-rw-r--r-- | static/js/fixedsearch.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/static/js/fixedsearch.ts b/static/js/fixedsearch.ts index 26b9ac1..3788cb3 100644 --- a/static/js/fixedsearch.ts +++ b/static/js/fixedsearch.ts @@ -9,6 +9,7 @@ const query = document.getElementById("search-input"); // input box for search const submit = document.getElementById("search-submit"); // form submit button const dropdown = document.getElementById("search-results"); // targets the <ul> + const container = document.getElementById("search-frame"); // targets the upper parent container form.addEventListener("focusin", function () { initialize(); @@ -79,6 +80,7 @@ scrolls = 0; document.activeElement.blur(); dropdown.setAttribute("hidden", ""); + container.removeAttribute("data-focus"); } scrolls++; }); @@ -86,6 +88,7 @@ document.addEventListener("click", function (event) { if (!form.contains(event.target)) { dropdown.setAttribute("hidden", ""); + container.removeAttribute("data-focus"); } }); @@ -163,6 +166,7 @@ </li> `; dropdown.removeAttribute("hidden"); + container.setAttribute("data-focus", ""); } else { dropdown.removeAttribute("hidden"); for (const string in results.slice(0, 10)) { |