diff options
Diffstat (limited to 'static/js/index.js')
-rw-r--r-- | static/js/index.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/static/js/index.js b/static/js/index.js index df649df..8c6e922 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -279,6 +279,7 @@ const query = document.getElementById("search-input"); document.getElementById("search-submit"); const dropdown = document.getElementById("search-results"); + const container = document.getElementById("search-frame"); form.addEventListener("focusin", function() { initialize(); }); @@ -331,12 +332,14 @@ scrolls = 0; document.activeElement.blur(); dropdown.setAttribute("hidden", ""); + container.removeAttribute("data-focus"); } scrolls++; }); document.addEventListener("click", function(event) { if (!form.contains(event.target)) { dropdown.setAttribute("hidden", ""); + container.removeAttribute("data-focus"); } }); function fetch_JSON(path, callback) { @@ -401,6 +404,7 @@ </li> `; dropdown.removeAttribute("hidden"); + container.setAttribute("data-focus", ""); } else { dropdown.removeAttribute("hidden"); for(const string in results.slice(0, 10)){ |