From 4b21c87a4e2deb07293c0cec39a1ac5d6e694773 Mon Sep 17 00:00:00 2001 From: gravel Date: Fri, 4 Aug 2023 06:37:48 +0000 Subject: [PATCH] Scroll on search bar focus to make more space --- output/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/output/main.js b/output/main.js index b631428c..40c7cb6f 100644 --- a/output/main.js +++ b/output/main.js @@ -451,7 +451,10 @@ function addServerIconInteractions() { function addSearchInteractions() { dom.toggle_search_checkbox()?.addEventListener('click', function (ev) { if (this.checked) { - dom.search_bar()?.focus(); + const searchBar = dom.search_bar(); + searchBar?.focus(); + // Inconsistent; attempt to align search bar to top to make more space for results. + searchBar?.scrollIntoView({ behavior: 'smooth', inline: 'start' }); } else { useSearchTerm(""); }