feat: preselect 1st item when opening new menus

This commit is contained in:
tomasklaen
2022-08-24 13:14:38 +02:00
parent 016d80e477
commit 5da3885c2d

View File

@@ -3199,6 +3199,10 @@ end
function toggle_menu_with_items(items, menu_options)
menu_options = menu_options or {}
menu_options.type = 'menu'
-- preselect 1st item
if not menu_options.selected_index then menu_options.selected_index = 1 end
if menu:is_open('menu') then
menu:close()
elseif items then