Skip to content

[BUG] Popup is not working on Windows whe opend from a modal #2459

Closed

Description

@dhindrik

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

When I trying to open a popup on Windows and are on a modal page I get the following exception,

System.Runtime.InteropServices.COMException: 'Catastrophic failure

XamlRoot must be explicitly set for unparented popup.'

It works on iOS and Android.

Expected Behavior

Popup to open.

Steps To Reproduce

  1. Run the app from the reproduction repo
  2. Click the button "Open modal page"
  3. Click the button "Open popup"
  4. Observe the exception

Link to public reproduction project repository

https://github.com/dhindrik/PopupOnModalPageBug

Environment

- .NET MAUI CommunityToolkit: 11.0 
- OS: Windows
- .NET MAUI: 9.0.30

Anything else?

No response

Activity

  1. sferhah commented on Jan 21, 2025

    @sferhah

    The method MapOnOpened assigns a null value to the XamlRoot : handler.PlatformView.XamlRoot = parent.XamlRoot

    On Mopup this never happens and it uses something like this:
    handler.PlatformView.XamlRoot = Application.Current.MainPage.Handler.MauiContext.Services.GetService<Microsoft.UI.Xaml.Window>().Content.XamlRoot;

  2. tobiasguelpen commented on Jan 28, 2025

    @tobiasguelpen

    This issue also happens with CommunityToolkit 10. and MAUI: 9.0.21.
    Right now it is blocking us from updating the CommunityToolkit.

  3. ne0rrmatrix commented on Jan 28, 2025

    @ne0rrmatrix
    Member

    I have tested this with the provided sample and found popup does crash when using modal navigation.

  4. asi-evin commented on Jan 28, 2025

    @asi-evin

    Still an issue in CommunityToolkit 11.0 and MAUI 9.30. Also a blocking issue for me.

  5. locked and limited conversation to collaborators on Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions