From f1b05a768ed33f47b50a7338593f024f95769342 Mon Sep 17 00:00:00 2001 From: d4 r c k h Date: Wed, 14 Oct 2020 21:21:06 +0300 Subject: [PATCH] focus input upon accessing the website --- scripts.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts.js b/scripts.js index 285854e..d27ea06 100644 --- a/scripts.js +++ b/scripts.js @@ -11,6 +11,10 @@ window.addEventListener('DOMContentLoaded', function() { var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); + function focusInput() { + inputField.focus() + } + function updateFragment(text) { // Don't spam the browser history & strip query strings. window.location.replace(location.origin + '/#' + encodeURIComponent(text)); @@ -158,6 +162,8 @@ window.addEventListener('DOMContentLoaded', function() { updateFragment(WELCOME_MSG); } + + focusInput(); renderText(); initAnalytics(); });