From fbad93e808fec53bdc94199c77ce5e57aad42a73 Mon Sep 17 00:00:00 2001 From: Alexandre FLAMENT Date: Thu, 2 Jun 2022 20:33:31 +0000 Subject: [PATCH] Theme: enable autofocus of #q only on the index page and when the width > 50em Related to #1270 --- searx/static/themes/simple/src/js/main/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/static/themes/simple/src/js/main/search.js b/searx/static/themes/simple/src/js/main/search.js index 20e58e0fe..b96cf499d 100644 --- a/searx/static/themes/simple/src/js/main/search.js +++ b/searx/static/themes/simple/src/js/main/search.js @@ -86,7 +86,7 @@ qinput.addEventListener('focus', placeCursorAtEndOnce, false); - if (!isMobile) { + if (!isMobile && document.querySelector('.index_endpoint')) { qinput.focus(); } }