Skip to content

Commit

Permalink
fix: Deleting a group doesn't delete children/links + batch
Browse files Browse the repository at this point in the history
  • Loading branch information
zHaytam committed Mar 22, 2021
1 parent 78b4395 commit 01bd076
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Blazor.Diagrams.Core/Diagram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,13 @@ public void RemoveGroup(GroupModel group)
if (!_groups.Remove(group))
return;

// Todo: batch Refresh()
group.Ungroup();
Nodes.Remove(group.Children.ToArray());
Links.Remove(group.AllLinks.ToArray());
GroupRemoved?.Invoke(group);
Refresh();
Batch(() =>
{
Nodes.Remove(group.Children.ToArray());
Links.Remove(group.AllLinks.ToArray());
group.Ungroup();
GroupRemoved?.Invoke(group);
});
}

#endregion
Expand Down

0 comments on commit 01bd076

Please sign in to comment.