mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 16:44:33 +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 searchForm = document.getElementById("module-search-form");
|
||||||
let topSearchResultListItem = undefined;
|
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) {
|
if (searchBox != null) {
|
||||||
function searchKeyDown(event) {
|
function searchKeyDown(event) {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue