Skip to content

Commit 0e8da23

Browse files
committed
Fix XamlRoot being set incorrectly in Popup Handler when using modal navigation in Windows
1 parent fbfd456 commit 0e8da23

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/CommunityToolkit.Maui.Core/Handlers/Popup/PopUpHandler.windows.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ public static void MapOnOpened(PopupHandler handler, IPopup view, object? result
4141
ArgumentNullException.ThrowIfNull(handler.MauiContext);
4242

4343
var parent = view.Parent.ToPlatform(handler.MauiContext);
44-
4544
parent.IsHitTestVisible = false;
46-
handler.PlatformView.XamlRoot = parent.XamlRoot;
45+
handler.PlatformView.XamlRoot = view.GetWindow().Content?.Handler?.MauiContext?.GetPlatformWindow().Content.XamlRoot ?? throw new InvalidOperationException("Window Content cannot be null");
4746
handler.PlatformView.IsHitTestVisible = true;
4847
handler.PlatformView.IsOpen = true;
4948

0 commit comments

Comments
 (0)