From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Thu, 1 May 2025 05:32:37 +0000 (-0400) Subject: Fix listcontainer constantly disposing children (#37089) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=55ef51a84bb0cbe6233bf9f7ba272839adad1a58;p=space-station-14.git Fix listcontainer constantly disposing children (#37089) --- diff --git a/Content.Client/UserInterface/Controls/ListContainer.cs b/Content.Client/UserInterface/Controls/ListContainer.cs index 0ee0a67af0..0bd7d32215 100644 --- a/Content.Client/UserInterface/Controls/ListContainer.cs +++ b/Content.Client/UserInterface/Controls/ListContainer.cs @@ -264,12 +264,6 @@ public class ListContainer : Control _updateChildren = false; var toRemove = new Dictionary(_buttons); - foreach (var child in Children.ToArray()) - { - if (child == _vScrollBar) - continue; - RemoveChild(child); - } if (_data.Count > 0) { @@ -292,8 +286,9 @@ public class ListContainer : Control if (Toggle && data == _selected) button.Pressed = true; + AddChild(button); } - AddChild(button); + button.SetPositionInParent(i - _topIndex); button.Measure(finalSize); } }