Skip to content

Commit

Permalink
hide search-results on blur (getzola#1488)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-alizadeh authored Jun 3, 2021
1 parent 7fab9b4 commit 6351591
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/static/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ function initSearch() {
$searchResultsItems.appendChild(item);
}
}, 150));

window.addEventListener('click', function(e) {
if ($searchResults.style.display == "block" && !$searchResults.contains(e.target)) {
$searchResults.style.display = "none";
}
});
}


Expand Down

0 comments on commit 6351591

Please sign in to comment.