From dfe177447cf001fa9e19ae2d21a9a619665c67c7 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Sat, 3 May 2025 22:11:38 +0200 Subject: [PATCH] add auto selecting first item in item list context menu if no selection --- Source/Editor/GUI/ItemsListContextMenu.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Editor/GUI/ItemsListContextMenu.cs b/Source/Editor/GUI/ItemsListContextMenu.cs index bf425a46b..82699e55c 100644 --- a/Source/Editor/GUI/ItemsListContextMenu.cs +++ b/Source/Editor/GUI/ItemsListContextMenu.cs @@ -611,6 +611,16 @@ namespace FlaxEditor.GUI OnClickItem(focusedItem); return true; } + else + { + // Select first item if no item is focused (most likely to be the best result), saves the user from pressing arrow down first + var visibleItems = GetVisibleItems(); + if (visibleItems.Count > 0) + { + OnClickItem(visibleItems[0]); + return true; + } + } break; }