From 8cc2cec5605cdc47b5a16e083fdf356d399e28da Mon Sep 17 00:00:00 2001 From: ATM john Date: Sat, 19 Jun 2021 16:56:08 +0200 Subject: [PATCH] Fix search drop down --- htdocs/main.inc.php | 23 +++++++++++++++++++++-- htdocs/theme/eldy/dropdown.inc.php | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index bcda6447c06..affa435d389 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2565,7 +2565,7 @@ function top_menu_search() - '; @@ -2587,6 +2587,26 @@ function top_menu_search() } }); + // arrow key nav + $(document).keydown(function(e) { + // Get the focused element: + var $focused = $(":focus"); + if($focused.length && $focused.hasClass("global-search-item")){ + + // UP - move to the previous line + if (e.keyCode == 38) { + e.preventDefault(); + $focused.prev().focus(); + } + + // DOWN - move to the next line + if (e.keyCode == 40) { + e.preventDefault(); + $focused.next().focus(); + } + } + }); + // submit form action $(".dropdown-global-search-button-list .global-search-item").on("click", function(event) { @@ -2619,7 +2639,6 @@ function top_menu_search() var openGlobalSearchDropDown = function() { - event.preventDefault(); $("#topmenu-global-search-dropdown").toggleClass("open"); $("#top-global-search-input").focus(); } diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index e0976e0e1db..cfd5415a90c 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -392,7 +392,7 @@ a.top-menu-dropdown-link { background-repeat: no-repeat; background-size: 16px 16px; background-position: 95% center; - border-radius: 10px; + border-radius: 20px; border: 1px solid #c4c4c2 !important; transition: all 250ms ease-in-out; backface-visibility: hidden;