From b939893c3aed0ebe046076f6bf9afc39683001d4 Mon Sep 17 00:00:00 2001 From: koirand Date: Mon, 24 Feb 2020 01:11:02 +0900 Subject: [PATCH] Focus search box when page opened. --- assets/js/search.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/js/search.js b/assets/js/search.js index a4f2f24..79ff895 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -96,6 +96,7 @@ const initUI = () => { $('#searchBoxIcon').click(() => { $('#searchBoxInput').val('') $('#searchBoxInput').trigger('keyup') + $('#searchBoxInput').focus() }) // Event when chenging query @@ -126,6 +127,9 @@ const initUI = () => { // Emit keyup event for when the query is already setted with browser back etc. $('#searchBoxInput').trigger('keyup') + + // Focus at searchBox + $('#searchBoxInput').focus() } /**