Skip to content

Fix [Android] Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage#34839

Open
KarthikRajaKalaimani wants to merge 5 commits intodotnet:mainfrom
KarthikRajaKalaimani:fix-33615
Open

Fix [Android] Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage#34839
KarthikRajaKalaimani wants to merge 5 commits intodotnet:mainfrom
KarthikRajaKalaimani:fix-33615

Conversation

@KarthikRajaKalaimani
Copy link
Copy Markdown
Contributor

@KarthikRajaKalaimani KarthikRajaKalaimani commented Apr 7, 2026

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:

  • Android
  • Windows
  • iOS
  • Mac

Reference:

N/A

Issues Fixed:

Fixes #33615

Screenshots

Before After
33615_Before.mov
33615_After.mov

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34839

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34839"

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Apr 7, 2026
@sheiksyedm
Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests , maui-pr-devicetests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 the FlyoutPage.Toolbar created by the current NavigationPage even when flyoutPage.Parent is already null.
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-flyoutpage FlyoutPage community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage

4 participants