From c3f6860e5517ba02d11e9266c579e34dc971f0a3 Mon Sep 17 00:00:00 2001 From: christoph-heinrich Date: Tue, 26 Sep 2023 20:51:01 +0200 Subject: [PATCH] tweak: scroll to top on search Selecting the top search result allows one to immediatelly activating an item after typing without having to navigate to it. --- scripts/uosc/elements/Menu.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/uosc/elements/Menu.lua b/scripts/uosc/elements/Menu.lua index 07652a6e..cba0751c 100644 --- a/scripts/uosc/elements/Menu.lua +++ b/scripts/uosc/elements/Menu.lua @@ -754,6 +754,8 @@ function Menu:search_internal(menu) local query = menu.search.query:lower() menu.items = query ~= '' and fuzzy_search(menu.search.source, query) or menu.search.source.items self:search_update_items() + self:select_index(1, menu) + self:scroll_to_index(1, menu) end ---@param menu? MenuStack