Skip to content

Commit

Permalink
fix(skia): Remove inner visual from panel on element removal
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Sep 24, 2020
1 parent 4f02e17 commit 6bd6a03
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Uno.UI/UI/Xaml/UIElement.Skia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,7 @@ internal bool RemoveChild(UIElement child)
{
if (_children.Remove(child))
{
child.SetParent(null);

Visual?.Children.Remove(child.Visual);

OnChildRemoved(child);

InnerRemoveChild(child);
return true;
}
else
Expand All @@ -167,14 +162,20 @@ internal void ClearChildren()
{
foreach (var child in _children.ToArray())
{
child.SetParent(null);
OnChildRemoved(child);
InnerRemoveChild(child);
}

_children.Clear();
InvalidateMeasure();
}

private void InnerRemoveChild(UIElement child)
{
child.SetParent(null);
Visual?.Children.Remove(child.Visual);
OnChildRemoved(child);
}

internal UIElement FindFirstChild() => _children.FirstOrDefault();

public string Name { get; set; }
Expand Down

0 comments on commit 6bd6a03

Please sign in to comment.