diff --git a/Source/Editor/GUI/ItemsListContextMenu.cs b/Source/Editor/GUI/ItemsListContextMenu.cs
index 5f09342c7..95a9a2164 100644
--- a/Source/Editor/GUI/ItemsListContextMenu.cs
+++ b/Source/Editor/GUI/ItemsListContextMenu.cs
@@ -52,7 +52,7 @@ namespace FlaxEditor.GUI
public float SortScore;
///
- /// Wether the query highlights should be draw.
+ /// Whether the query highlights should be drawn.
///
public bool DrawHighlights = true;
@@ -261,6 +261,11 @@ namespace FlaxEditor.GUI
///
public readonly VerticalPanel ItemsPanel;
+ ///
+ /// Gets a list of panels with item categories.
+ ///
+ public IEnumerable CategoryPanels => (IEnumerable)_categoryPanels ?? Array.Empty();
+
///
/// Initializes a new instance of the class.
///
@@ -504,6 +509,12 @@ namespace FlaxEditor.GUI
category.Visible = true;
category.Close(false);
}
+
+ if (_categoryPanels.Count == 1 && items.Count == 1)
+ {
+ // Expand the only category if there are no items outside of it
+ _categoryPanels[0].Open(false);
+ }
}
_searchBox?.Clear();