diff --git a/website/static/main.js b/website/static/main.js index 223100ea..c1d8d019 100644 --- a/website/static/main.js +++ b/website/static/main.js @@ -351,8 +351,10 @@ if (backToTop) { window.addEventListener('resize', updateBackToTopVisibility); backToTop.addEventListener('click', function () { - if (!resultsSection) return; - resultsSection.scrollIntoView({ behavior: 'smooth', block: 'start' }); + var target = searchInput || resultsSection; + if (!target) return; + target.scrollIntoView({ behavior: 'smooth', block: 'center' }); + if (searchInput) searchInput.focus(); }); updateBackToTopVisibility(); diff --git a/website/templates/index.html b/website/templates/index.html index f3183f30..a2e737d8 100644 --- a/website/templates/index.html +++ b/website/templates/index.html @@ -129,8 +129,8 @@