enisn / UraniumUI

Uranium is a Free & Open-Source UI Kit for MAUI.
Apache License 2.0
1.17k stars 142 forks source link

Dialogs are not dismissing on navigated pages causing an eventual crash #665

Open laszlodaniel opened 6 months ago

laszlodaniel commented 6 months ago

Description

None of the dialog services work on navigated pages. Dialogs pop up and seemingly return information but they won't disappear. Then an unhandled exception is thrown on second button tap.

Dialogs are ok on the main page.

CommunityToolkitDialog and MopupsDialog is also affected.

UraniumUI_Popup_issue_01

Steps to reproduce

Download and try this sample project: UraniumUIPopupTest.zip.

Version with bug

        <PackageReference Include="CommunityToolkit.Maui" Version="9.0.0" />
        <PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
        <PackageReference Include="Microsoft.Maui.Controls" Version="8.0.21" />
        <PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.21" />
        <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
        <PackageReference Include="UraniumUI" Version="2.8.1" />
        <PackageReference Include="UraniumUI.Dialogs.CommunityToolkit" Version="2.8.1" />
        <PackageReference Include="UraniumUI.Dialogs.Mopups" Version="2.8.1" />
        <PackageReference Include="UraniumUI.Material" Version="2.8.1" />
enisn commented 6 months ago

Mopups & Community Toolkit dialogs are working but DefaultDialogService doesn't work. It seems it's related to AppShell navigation logic.

If you remove the following line from MauiProgram.cs, CommunityToolkit or Mopups implementation will work.

builder.Services.AddSingleton<IDialogService, DefaultDialogService>();

image mopups-work

I'll take a look at Default implementation, it may be related to a MAUI bug since code seems correct

enisn commented 4 months ago

Probably fixed by https://github.com/enisn/UraniumUI/pull/701/files

I'll check