From cba76c3f41064e2f861fe38cd1fd1407ac3dd808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Tue, 16 Nov 2021 01:16:31 +0100 Subject: [PATCH] search: make dropdown stick to search field when scrolling #155 --- static/css/theme.css | 1 + static/js/search.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/static/css/theme.css b/static/css/theme.css index b9136bc865..8f97f7385b 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -104,6 +104,7 @@ textarea:hover, input[type="email"]:hover, input[type="number"]:hover, input[typ text-align: center; border-bottom: 4px solid #9c6fb6; padding: 1rem; + position: relative; } #header a { display: inline-block; diff --git a/static/js/search.js b/static/js/search.js index 8065cf1bfb..ed083dbdd7 100644 --- a/static/js/search.js +++ b/static/js/search.js @@ -65,7 +65,8 @@ initLunr(); $(function() { var searchList = new autoComplete({ /* selector for the search box element */ - selector: $('#search-by').get(0), + selectorToInsert: '#header-wrapper', + selector: '#search-by', /* source is the callback to perform the search */ source: function(term, response) { response(search(term));