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

Fix syncing modal stack when the window is created/recreated #13025

Merged
merged 42 commits into from
Mar 16, 2023

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Jan 31, 2023

Description of Change

Fix ModalNavigationManager so it will reprocess the current Modal stack when the root window handler changes. Currently we aren't processing any modal pages pushed before the app has loaded and we don't reprocess the modal stack if the window is destroyed and recreated (Android).

This PR adds code to detect when we need to reprocess the modal stack based on the root view changing or being destroyed

Breaking Changes

Issues Fixed

Fixes #8157

@PureWeen PureWeen changed the title Fix modal syncing Fix syncing modal stack when the window is created/recreated Jan 31, 2023
@PureWeen PureWeen force-pushed the fix_modal_syncing branch 3 times, most recently from d8e5af8 to 7548317 Compare February 6, 2023 23:09
nextPage?.SendNavigatedTo(new NavigatedToEventArgs(modal));

return result;
return _owner.ModalNavigationManager.PopModalAsync(animated);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved all of this code into ModalNavigationManager

@PureWeen PureWeen marked this pull request as ready for review February 7, 2023 20:43
Copy link
Member

@mandel-macaque mandel-macaque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments.

Copy link
Member

@mandel-macaque mandel-macaque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need a small comment about the try {} trick.

@PureWeen PureWeen requested a review from rmarinho March 7, 2023 00:30
@PureWeen
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).


namespace Microsoft.Maui.Platform
{
internal class ModalWrapper : UIViewController
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this rather be an interface if it does not do anything specific?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps eventually?

At some point we'll move modals into core and those APIs will all get designed. There's not really a larger use case here yet for an interface so I don't think we need to make that leap yet.

@github-actions
Copy link
Contributor

Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modal Navigation does not work or throws exception prior to Window Creation/Parenting
6 participants