diff --git a/Terminal.Gui/Views/ComboBox.cs b/Terminal.Gui/Views/ComboBox.cs index 41523acb4..2ed8f83e7 100644 --- a/Terminal.Gui/Views/ComboBox.cs +++ b/Terminal.Gui/Views/ComboBox.cs @@ -126,9 +126,13 @@ namespace Terminal.Gui { // On resize LayoutComplete += (LayoutEventArgs a) => { - search.Width = Bounds.Width; - listview.Width = autoHide ? Bounds.Width - 1 : Bounds.Width; - listview.Height = CalculatetHeight (); + if (!autoHide && search.Frame.Width != Bounds.Width || + autoHide && search.Frame.Width != Bounds.Width - 1) { + search.Width = listview.Width = autoHide ? Bounds.Width - 1 : Bounds.Width; + listview.Height = CalculatetHeight (); + search.SetRelativeLayout (Bounds); + listview.SetRelativeLayout (Bounds); + } }; listview.SelectedItemChanged += (ListViewItemEventArgs e) => { @@ -138,12 +142,6 @@ namespace Terminal.Gui { } }; - // This is needed in addition to 'Adding' to trigger the capture the Bounds.Width & Height - Application.Loaded += (Application.ResizedEventArgs a) => { - SetNeedsLayout (); - Search_Changed (Text); - }; - Adding += (View v) => { // Determine if this view is hosted inside a dialog