new-tab: Timeout für Fokus
authorMalte Bublitz <malte@rolltreppe3.de>
Sun, 2 Oct 2022 20:20:07 +0000 (22:20 +0200)
committerMalte Bublitz <malte@rolltreppe3.de>
Sun, 2 Oct 2022 20:20:07 +0000 (22:20 +0200)
js/new-tab.js

index d33d765918de9429d42979c67a040a66ffd8360e..efe1ffedcd83b2c3f660093e202acee495ccdc2b 100644 (file)
@@ -23,6 +23,9 @@ window.onload = function() {
         * Set focus to search <input>
         */
        document.querySelector("input[type=search]").focus();
+       setTimeout(() => {
+               document.querySelector("input[type=search]").focus();
+       }, 100);
        
        /**
         * Redirect if an URL was entered in the search form
@@ -34,4 +37,4 @@ window.onload = function() {
                        event.preventDefault();
                }
        });
-};
\ No newline at end of file
+};