Fix [Android] Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage#34839
Open
KarthikRajaKalaimani wants to merge 5 commits intodotnet:mainfrom
Open
Fix [Android] Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage#34839KarthikRajaKalaimani wants to merge 5 commits intodotnet:mainfrom
KarthikRajaKalaimani wants to merge 5 commits intodotnet:mainfrom
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34839Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34839" |
Contributor
|
/azp run maui-pr-uitests , maui-pr-devicetests |
|
Azure Pipelines successfully started running 2 pipeline(s). |
This was referenced Apr 7, 2026
Open
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a toolbar lifecycle edge-case when swapping Window.Page away from (and back to) a FlyoutPage, which could leave a stale/disconnected NavigationPageToolbar attached and prevent subsequent title updates. Adds a new UI test and corresponding visual baselines to validate the title updates after returning from a non-flyout root page.
Changes:
- Update
NavigationPage.OnWindowChanged(null)to clear theFlyoutPage.Toolbarcreated by the currentNavigationPageeven whenflyoutPage.Parentis alreadynull. - Add new HostApp issue page + Appium UI test for Issue #33615 validating the title update scenario.
- Add visual baseline images for the new screenshot-based UI test.
Reviewed changes
Copilot reviewed 3 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Controls/src/Core/NavigationPage/NavigationPage.cs | Removes an overly-strict guard so the stale toolbar is correctly cleared during Window.Page swaps. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue33615.cs | Adds a repro page that swaps Window.Page to a non-flyout page and back, then navigates to a second detail page. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33615.cs | Adds an Appium UI test that verifies the title updates via VerifyScreenshot(). |
| src/Controls/tests/TestCases.Android.Tests/snapshots/android/TitleUpdatesAfterShowingNonFlyoutPage.png | Android baseline image for the new visual assertion. |
| src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/TitleUpdatesAfterShowingNonFlyoutPage.png | iOS baseline image for the new visual assertion. |
| src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/TitleUpdatesAfterShowingNonFlyoutPage.png | Windows baseline image for the new visual assertion. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Details:
Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage in Android Platform.
Root Cause:
When Window.Page is swapped from a FlyoutPage to a plain ContentPage, the Window.Page setter clears flyoutPage.Parent = null synchronously before propagating the Window=null event through the element hierarchy. This means by the time NavigationPage.OnWindowChanged(null) fires to clean up the toolbar, the check flyoutPage.Parent is IWindow evaluates to false (Parent is already null). As a result, flyoutPage.Toolbar = null never executes — the stale, now-disconnected NavigationPageToolbar remains attached to
FlyoutPage.Toolbar. When FlyoutPage is later restored as Window.Page, FindMyToolbar() traverses the ancestors, finds the stale toolbar on FlyoutPage.Toolbar, and returns early — no new connected toolbar is created. Since the stale toolbar's ToolbarTracker subscriptions were severed by Disconnect(), it never receives CurrentPage change notifications, so the title is permanently frozen.
Description of Change:
Remove the flyoutPage.Parent is IWindow && condition from the guard in NavigationPage.OnWindowChanged(null) in NavigationPage.cs. The remaining check flyoutPage.Toolbar == _toolbar is the correct and sufficient invariant — it ensures we only clear the toolbar that this NavigationPage created. The Parent is IWindow guard was redundant in the normal case (when FlyoutPage is the root page, Parent is IWindow), but fatally incorrect during a Window.Page swap because the ordering guarantee it depended on didn't hold.
Tested the behavior in the following platforms:
Reference:
N/A
Issues Fixed:
Fixes #33615
Screenshots
33615_Before.mov
33615_After.mov