Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Present to UIWindow associated with passed in page #16983

Merged
merged 3 commits into from Aug 24, 2023
Merged

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Aug 24, 2023

Description of Change

  • Modify the code to just locate the current presenting ViewController opposed to iterating over modal pages
  • inspect the UIWindow on the incoming page. If that UIWindow is different from the current UIWindow then present the alert to that UIWindow. Mopups uses a new UIWindow to present its popups, so this will fix the issue by checking the UIWindow on the incoming page. This does require users to call "DisplayAlert" on the ContentPage that's used inside the Mopup popup itself, which seems acceptable for now instead of trying to be too smart and try to figure out what UIWindow to present from.

This scenario changed/broke when moving to MAUI because in XF we used a new UIWindow for all our alerts which always presented on top where as with MAUI we changed that code to just present as a new ViewController

pageController.PresentViewControllerAsync(alert, true);

Issues Fixed

Fixes #16321

@PureWeen PureWeen merged commit 4e269db into main Aug 24, 2023
34 checks passed
@PureWeen PureWeen deleted the fix-16321-repro branch August 24, 2023 22:56
@davembond
Copy link

Hurrah! Thank you.
Will this be available in a Nuget Package or do we need to wait for the next Preview or GA for this one?

@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DisplayAlert Displaying Beneath PopupPage (Mopups) on iOS
3 participants