From 5e8854c9395b682fc5767cf94cda471285fdb6b6 Mon Sep 17 00:00:00 2001 From: Nelson Earle Date: Thu, 7 Nov 2024 16:07:42 -0600 Subject: [PATCH] fix(ui): scroll to focused button in map select --- src/ui/map_select.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ui/map_select.rs b/src/ui/map_select.rs index 78228c84a0..56703719b7 100644 --- a/src/ui/map_select.rs +++ b/src/ui/map_select.rs @@ -81,6 +81,10 @@ pub fn map_select_menu( .show(ui) .focus_by_default(ui); + if all_maps_button.has_focus() { + all_maps_button.scroll_to_me(None); + } + if all_maps_button.clicked() { // TODO: Currently does not include packs, only stable maps. let mut map_pool = @@ -98,6 +102,10 @@ pub fn map_select_menu( ) .show(ui); + if button.has_focus() { + button.scroll_to_me(None); + } + if button.clicked() { return MapSelectAction::SelectMap( MapPool::from_single_map(*handle), @@ -116,6 +124,10 @@ pub fn map_select_menu( ) .show(ui); + if button.has_focus() { + button.scroll_to_me(None); + } + if button.clicked() { return MapSelectAction::SelectMap( MapPool::from_single_map(*map),