mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 15:03:46 +00:00
Hide the results whenever anyone clicks outside
This commit is contained in:
parent
956d07f179
commit
52b261cf79
1 changed files with 7 additions and 0 deletions
|
@ -27,6 +27,13 @@
|
|||
let searchForm = document.getElementById("module-search-form");
|
||||
let topSearchResultListItem = undefined;
|
||||
|
||||
// Hide the results whenever anyone clicks outside the search results.
|
||||
window.addEventListener("click", function(event) {
|
||||
if (!searchForm?.contains(event.target)) {
|
||||
searchTypeAhead.classList.add("hidden");
|
||||
}
|
||||
});
|
||||
|
||||
if (searchBox != null) {
|
||||
function searchKeyDown(event) {
|
||||
switch (event.key) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue