Skip to content

Commit

Permalink
Fix reparenting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Jun 30, 2019
1 parent 2c195c2 commit 94de081
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/Xamarin/Prism.Forms/Services/Dialogs/DialogService.cs
Expand Up @@ -242,12 +242,12 @@ private void InsertPopupViewInCurrentPage(ContentPage currentPage, View popupVie

var overlay = new AbsoluteLayout();
overlay.SetValue(IsPopupHostProperty, true);
var existingContent = currentPage.Content;
var content = new DialogContainer
{
Padding = currentPage.Padding,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Content = currentPage.Content,
IsPageContent = true
};
currentPage.Padding = new Thickness(0);
Expand Down Expand Up @@ -289,6 +289,9 @@ private void InsertPopupViewInCurrentPage(ContentPage currentPage, View popupVie
overlay.Children.Add(mask);
overlay.Children.Add(popupContainer);
currentPage.Content = overlay;

// The original content needs to be reparented after the Page Content has been reset.
content.Content = existingContent;
}

private static Style GetOverlayStyle(View popupView)
Expand Down

0 comments on commit 94de081

Please sign in to comment.