Dialogs are not dismissing on navigated pages causing an eventual crash
laszlodaniel opened this issue · 2 comments
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.
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" />
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>();
I'll take a look at Default implementation, it may be related to a MAUI bug since code seems correct
Probably fixed by https://github.com/enisn/UraniumUI/pull/701/files
I'll check