Skip to content

Commit

Permalink
tweak: scroll to top on search
Browse files Browse the repository at this point in the history
Selecting the top search result allows one to immediatelly activating an
item after typing without having to navigate to it.
  • Loading branch information
christoph-heinrich committed Sep 26, 2023
1 parent 8a3892d commit 9de6198
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/uosc/elements/Menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,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
Expand Down

0 comments on commit 9de6198

Please sign in to comment.