Skip to content

Alert popup may be displayed on wrong window when modal page navigation is in progress on iOS/MacOS #30970

@rafalka

Description

@rafalka

Description

This issue is seen only on iOS/MacOS and only in conjunction with a modal page navigation.
"Regular" navigation is fine
When we closing a modal page, then Alert popup (and most likely other popups) may be displayed on a window which is no longer in a hierarchy.

This causing a deadlock as await DisplayAlert() does not return nor throwing an exception.

Steps to Reproduce

  1. Open new modal page
  2. Close it
  3. Show alert using DisplayAlert()

Expected result: popup shown
Actual results: popup not visible but await DisplayAlert() does not return.

Link to public reproduction project repository

https://github.com/rafalka/MauiAlertModalNavigationIssue

Version with bug

9.0.90 SR9

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

iOS 18.5, MacOS 15.5

Did you find any workaround?

No

Relevant log output

[Presentation] Attempt to present <UIAlertController: 0x106a6f000> on <Microsoft_Maui_Controls_Platform_ControlsModalWrapper: 0x105e36f40> (from <Microsoft_Maui_Controls_Platform_ControlsModalWrapper: 0x105e36f40>) whose view is not in the window hierarchy.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions