Fix listcontainer constantly disposing children (#37089)

This commit is contained in:
Nemanja
2025-05-01 01:32:37 -04:00
committed by GitHub
parent c1ebbb0789
commit 55ef51a84b

View File

@@ -264,12 +264,6 @@ public class ListContainer : Control
_updateChildren = false; _updateChildren = false;
var toRemove = new Dictionary<ListData, ListContainerButton>(_buttons); var toRemove = new Dictionary<ListData, ListContainerButton>(_buttons);
foreach (var child in Children.ToArray())
{
if (child == _vScrollBar)
continue;
RemoveChild(child);
}
if (_data.Count > 0) if (_data.Count > 0)
{ {
@@ -292,8 +286,9 @@ public class ListContainer : Control
if (Toggle && data == _selected) if (Toggle && data == _selected)
button.Pressed = true; button.Pressed = true;
}
AddChild(button); AddChild(button);
}
button.SetPositionInParent(i - _topIndex);
button.Measure(finalSize); button.Measure(finalSize);
} }
} }