diff --git a/Intersect.Client.Framework/Gwen/Control/ComboBox.cs b/Intersect.Client.Framework/Gwen/Control/ComboBox.cs index b7b1db5f6e..214878deaa 100644 --- a/Intersect.Client.Framework/Gwen/Control/ComboBox.cs +++ b/Intersect.Client.Framework/Gwen/Control/ComboBox.cs @@ -422,10 +422,8 @@ private static void Open(ComboBox @this) var menuItems = @this._menu.Children.OfType().ToArray(); foreach (var menuItem in menuItems) { - menuItem.SizeToContents(); + menuItem.AutoSizeToContents = false; totalChildHeight += menuItem.OuterHeight; - // TODO(2553): I thought this was the solution, it isn't. Results in menu growing each time it's opened. - // width = Math.Max(width, menuItem.OuterWidth + menuPaddingH); } var offset = @this.ToCanvas(default); diff --git a/Intersect.Client.Framework/Gwen/Control/ContextMenu.cs b/Intersect.Client.Framework/Gwen/Control/ContextMenu.cs index 7a04e6188e..552f5c616e 100644 --- a/Intersect.Client.Framework/Gwen/Control/ContextMenu.cs +++ b/Intersect.Client.Framework/Gwen/Control/ContextMenu.cs @@ -1,23 +1,3 @@ namespace Intersect.Client.Framework.Gwen.Control; -public class ContextMenu : Menu -{ - public ContextMenu(Base parent, string? name = default) : base(parent, name) - { - - } - - protected override void OnPositioningBeforeOpen() - { - base.OnPositioningBeforeOpen(); - - SizeToChildren(recursive: true); - } - - protected override void OnOpen() - { - base.OnOpen(); - - PostLayout.Enqueue(contextMenu => contextMenu.SizeToChildren(recursive: true), this); - } -} \ No newline at end of file +public class ContextMenu(Base parent, string? name = default) : Menu(parent, name); \ No newline at end of file diff --git a/Intersect.Client.Framework/Gwen/Control/Menu.cs b/Intersect.Client.Framework/Gwen/Control/Menu.cs index 861795a131..4ca64fd030 100644 --- a/Intersect.Client.Framework/Gwen/Control/Menu.cs +++ b/Intersect.Client.Framework/Gwen/Control/Menu.cs @@ -193,7 +193,13 @@ private static void Open(Menu @this, Pos position) protected virtual void OnPositioningBeforeOpen() { + var menuItems = Children.OfType().ToArray(); + foreach (var menuItem in menuItems) + { + menuItem.AutoSizeToContents = false; + } + SizeToChildren(recursive: true); } protected virtual void OnOpen()