From 8408ebf944adb4746b1f87884d84e6a3679a2401 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sat, 30 Sep 2023 12:13:37 +0200 Subject: [PATCH] enable search field autofocus --- layouts/partials/head.html | 3 ++- layouts/partials/header.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c7508c39..bfabcf59 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -29,7 +29,8 @@ zero_results: "Leider konnten keine Ergebnisse zu [SEARCH_TERM] gefunden werden", clear_search: "Löschen" } - }); + }); + document.getElementsByClassName("pagefind-ui__search-input")[0].autofocus=true; }); diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 7a983034..bad3accd 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -67,7 +67,7 @@ {{ end }} {{ end }}