mirror of
https://github.com/benbusby/whoogle-search.git
synced 2026-05-24 08:32:30 -04:00
Added search input auto focus, updated README
The javascript controller has been updated to include a call to focus the cursor on the search field. This previously had only been seen on Firefox, and was assumed to be a weird FF-specific bug. Adding in a timeout to allow elements to finish loading allows the field to be focused as expected. Also updated the README to include clarification for IP address tracking.
This commit is contained in:
@@ -8,6 +8,7 @@ CONFIG_STRS = [
|
||||
"near", "url"
|
||||
];
|
||||
|
||||
|
||||
const setupSearchLayout = () => {
|
||||
// Setup search field
|
||||
const searchBar = document.getElementById("search-bar");
|
||||
@@ -114,4 +115,8 @@ document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
setupSearchLayout();
|
||||
setupConfigLayout();
|
||||
|
||||
// Focusing on the search input field requires a delay for elements to finish
|
||||
// loading (seemingly only on FF)
|
||||
setTimeout(function() { document.getElementById("search-bar").focus(); }, 250);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user