Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Improve focus on reload, back, etc

Daoud Clarke8f8fc43c9f25
diff --git a/static/index.js b/static/index.js
index 97c4061..f12d83f 100644
--- a/static/index.js
+++ b/static/index.js
@@ -39,17 +39,21 @@ window.onload = (event) => {
} else if (e.key == 'ArrowUp') {
selectPreviousItem();
} else if (e.key == 'Enter') {
- clickSelected();
- }
+// const form = document.getElementById('search-form');
+// form.submit();
+// event.preventDefault();
+ }
});
// Handle pressing enter
const form = document.getElementById('search-form');
- form.addEventListener( "submit", event => {
+ form.addEventListener("submit", event => {
event.preventDefault();
clickSelected();
});
+
+ searchInput.focus();
};