Skip to content

Commit

Permalink
Only set the popup contents parent if it hasn't already been set befo…
Browse files Browse the repository at this point in the history
…re (#2199)

Co-authored-by: Shaun Lawrence <[email protected]>
  • Loading branch information
bijington and bijington authored Sep 12, 2024
1 parent 713b4f0 commit 52b84a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,12 @@ protected override void OnBindingContextChanged()
if (Content is not null)
{
SetInheritedBindingContext(Content, BindingContext);
Content.Parent = this;

if (ReferenceEquals(Content.Parent, this) is false)
{
Content.Parent = null;
Content.Parent = this;
}
}
}

Expand Down

0 comments on commit 52b84a9

Please sign in to comment.