Fix for Shell tab visibility not updating when navigating back multiple pages#34403
Conversation
…#34317) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change Add `darc-*` to the `trigger: branches: include:` section in `ci-uitests.yml` and `ci-device-tests.yml` so that `maui-pr-uitests` and `maui-pr-devicetests` automatically run when dotnet-maestro pushes dependency updates to `darc-*` branches. Previously, these pipelines required manual `/azp run` comments on every maestro PR. ### Issues Fixed N/A - CI improvement ### Files Changed - `eng/pipelines/ci-uitests.yml` - Added `darc-*` to CI trigger branch filter - `eng/pipelines/ci-device-tests.yml` - Added `darc-*` to CI trigger branch filter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…otnet#34327) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description PR dotnet#34320 fixed RS0017 analyzer errors caused by `#nullable enable` being sorted to the bottom of 14 Maps `PublicAPI.Unshipped.txt` files. The root cause was a prior Copilot agent session that used `LC_ALL=C sort -u` to resolve merge conflicts — the BOM bytes (`0xEF 0xBB 0xBF`) sort after all ASCII characters, pushing the directive below the API entries. This updates the Copilot instructions to prevent this from recurring: - Explains that `#nullable enable` must remain on line 1 - Warns against using plain `sort` on these files (BOM sort ordering) - Provides a safe conflict resolution script that preserves the header before sorting API entries Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…otnet#34301) ### Description of Change Fixes a crash on Android when using `TapGestureRecognizer` with `GraphicsView`. ### Root Cause `PlatformTouchGraphicsView.TouchesMoved` assumed that `_lastMovedViewPoints` always contained at least one element. In certain touch event sequences (triggered when a TapGestureRecognizer is attached), `_lastMovedViewPoints` could be empty while `points.Length == 1`, leading to an IndexOutOfRangeException. ### Fix Added a length check before accessing `_lastMovedViewPoints[0]` to prevent out-of-range access. ### Verified Scenarios - TapGestureRecognizer no longer causes a crash - Tap events fire correctly - Drag interaction remains functional - Multitouch does not crash Fixes dotnet#34296
…lView (dotnet#34279) > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Root Cause PR dotnet#33281 added a `GetDesiredSize()` override in `LabelHandler.Android.cs` to fix issue dotnet#31782 (WordWrap labels reporting full constraint width instead of actual text width). The fix computes the longest wrapped line and returns that as the desired width. This causes a regression when `MaxLines` is set on the label: 1. `GetDesiredSize()` is called at the full available width — text wraps cleanly within MaxLines limit 2. The fix returns the shorter "longest line" width 3. The label is arranged at that narrower width 4. At the narrower width, the same text needs more lines — exceeding MaxLines → text is clipped ### Description of Change The `GetDesiredSize()` override now uses a double-measurement strategy: 1. **Entry guard**: Only applies the width-narrowing when `Ellipsize == null` (no active truncation). 2. **Compute candidate width**: Finds the widest rendered line as before. 3. **Safety check** (only when `MaxLines` is explicitly set): Re-measures the TextView at exactly the narrowed pixel width. If the re-measurement shows the text would now exceed `MaxLines`, the original full width is returned instead. 4. **Narrow when safe**: If the re-measurement confirms the same or fewer lines, the narrowed width is returned — preserving the dotnet#31782 alignment fix even for labels with explicit `MaxLines`. This avoids both regressions: - Labels without `MaxLines` behave as before (alignment fix preserved, no second measure). - Labels with `MaxLines` that have line-count headroom also get the alignment fix. ### Issues Fixed Fixes dotnet#34120 ### Tested platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac **Files Changed in this PR:** | File | Change | |------|--------| | `src/Core/src/Handlers/Label/LabelHandler.Android.cs` | Double-measurement fix (~20 lines) | | `src/Controls/tests/TestCases.HostApp/Issues/Issue34120.cs` | New UI test HostApp page | | `src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34120.cs` | New NUnit UI test | **Regression Reference:** - Regressed by: PR dotnet#33281 - Introduced in: 10.0.40 - Works in: 10.0.30, 10.0.31 - Platform: Android only ### Screenshots |Before|After| |--|--| |<img width="540" alt="image" src="https://github.com/user-attachments/assets/4c365c06-6aa9-4471-9553-d46983ec66c7" >|<img width="540" alt="image" src="https://github.com/user-attachments/assets/d67723d9-fd79-4dcc-8451-f1537f8b3668" >|
- Add android-arm64 and android-x64 test cases to PublishNativeAOT and PublishNativeAOTRootAllMauiAssemblies tests - Add PrepareNativeAotBuildPropsAndroid() with Android-specific build properties including ANDROID_NDK_ROOT support - Add ExpectedNativeAOTWarningsAndroid baseline (XA1040 + IL3050 warnings) - Use OnlyAndroid() helper on Linux to avoid iOS/macCatalyst workload issues --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nd pixel-level comparison (dotnet#34024) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Root Cause `SafeAreaInsetsDidChange` fires repeatedly during iOS animations (e.g., `TranslateToAsync`, bottom sheet transitions) as views move relative to the window. This caused two distinct infinite loop patterns: 1. **Sub-pixel oscillation** (dotnet#32586, dotnet#33934): Animations produce sub-pixel differences in `SafeAreaInsets` (e.g., `0.0000001pt`). Exact equality fails, triggering `InvalidateAncestorsMeasures` → layout pass → position change → new `SafeAreaInsetsDidChange` → infinite loop. 2. **Parent-child double application** (dotnet#33595): A `ContentPage` (implementing `ISafeAreaView`) and its child `Grid` both independently apply safe area adjustments. When the `ContentPage` adjusts its layout for the notch/status bar, it repositions the `Grid`. The `Grid`'s new position fires `SafeAreaInsetsDidChange`, causing it to re-apply its own adjustment — creating a ping-pong loop. ### Description of Change **Primary fix — `IsParentHandlingSafeArea` (parent hierarchy walk):** In both `MauiView.ValidateSafeArea` and `MauiScrollView.ValidateSafeArea`, before applying safe area adjustments, we now check whether an ancestor `MauiView` is already applying safe area for the **same edges**. If so, the child skips its own adjustment to avoid double-padding. The check is **edge-aware**: a parent handling `Top` does not block a child from independently handling `Bottom`. Only overlapping edges cause deferral. The `_parentHandlesSafeArea` result is cached per layout cycle and cleared on `SafeAreaInsetsDidChange`, `InvalidateSafeArea`, and `MovedToWindow`. **Secondary fix — `EqualsAtPixelLevel`:** Safe area values are compared at device-pixel resolution (rounding to `1 / ContentScaleFactor`) before deciding whether to trigger a layout invalidation. This absorbs sub-pixel animation noise and prevents the oscillation loops in dotnet#32586 and dotnet#33934. **MauiScrollView bug fixes:** - Inverted condition: `!UpdateContentInsetAdjustmentBehavior()` was incorrectly gating behavior; corrected to `UpdateContentInsetAdjustmentBehavior()`. - The `_appliesSafeAreaAdjustments` flag now correctly incorporates `!IsParentHandlingSafeArea()`. **What was removed:** - The "Window Guard" approach (comparing `Window.SafeAreaInsets` to filter noise) was tried and removed. It was fragile: on macCatalyst with a custom TitleBar, `WindowViewController` repositions content by pushing it down, which changes the view's own `SafeAreaInsets` without changing `Window.SafeAreaInsets`. The guard blocked this legitimate change, causing a 28px content shift regression in CI. ### Issues Fixed Fixes dotnet#32586 Fixes dotnet#33934 Fixes dotnet#33595 Fixes dotnet#34042 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Tamilarasan-Paranthaman <Tamilarasan-Paranthaman@users.noreply.github.com>
…rm navigation to ensure Shell TabBar visibility is applied correctly during multi-level back navigation.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34403Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34403" |
🤖 AI Summary📊 Expand Full Review🔍 Pre-Flight — Context & Validation📝 Review Session — Fix-33351-Made changes to trigger page appearing events before platform navigation to ensure Shell TabBar visibility is applied correctly during multi-level back navigation. ·
|
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #34403 | Reorder: PresentedPageDisappearing + PresentedPageAppearing before InvokeNavigationRequest; skip top page in cleanup loop |
⏳ PENDING (Gate) | ShellSection.cs (+17/-3), Issue33351.cs (HostApp, +167), Issue33351.cs (SharedTests, +34), 5 PNG snapshots |
Original PR; prior review approved on iOS |
🚦 Gate — Test Verification
📝 Review Session — Fix-33351-Made changes to trigger page appearing events before platform navigation to ensure Shell TabBar visibility is applied correctly during multi-level back navigation. · fb538bf
Result: ✅ PASSED
Platform: android
Mode: Full Verification
- Tests FAIL without fix ✅
- Tests PASS with fix ✅
Test: Issue33351.TabBarVisibilityAfterMultiLevelPopToRoot
Fix file verified: src/Controls/src/Core/Shell/ShellSection.cs
Note: Minor ADB installation error occurred on first attempt but recovered automatically. Final test result was clean: 1/1 tests passed in 24.31s.
🔧 Fix — Analysis & Comparison
📝 Review Session — Fix-33351-Made changes to trigger page appearing events before platform navigation to ensure Shell TabBar visibility is applied correctly during multi-level back navigation. · fb538bf
Fix Candidates
Note: This PR (#34403) is a continuation of PR #34280, which underwent a full 7-attempt try-fix exploration in a prior review session. The fix in ShellSection.cs is identical. Prior findings are imported below.
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix (prior) | Early if (IsVisibleSection) CurrentItem?.SendAppearing() before InvokeNavigationRequest (minimal 2-line add, keeps PresentedPageAppearing at end) |
✅ PASS | ShellSection.cs (+2) |
Works but fires appearing twice; simpler than PR |
| 2 | try-fix (prior) | Move _navStack reset + PresentedPageAppearing() before InvokeNavigationRequest (mirrors OnPopAsync, no cleanup loop changes) |
✅ PASS | ShellSection.cs (+1/-1) |
Clean reorder; doesn't handle disappearing side |
| 3 | try-fix (prior) | Deferred Dispatcher.Dispatch + synchronous Handler.UpdateValue after PresentedPageAppearing |
❌ FAIL | ShellSection.cs (+13) |
0.81% snapshot mismatch; post-navigation updates too late |
| 4 | try-fix (prior) | Reset _navStack, then InvokeNavigationRequest, then PresentedPageAppearing() before await args.Task |
✅ PASS | ShellSection.cs (+1/-1) |
Fires appearing after request dispatched but before await |
| 5 | try-fix (prior) | PresentedPageDisappearing() + if (IsVisibleSection) CurrentItem?.SendAppearing() before InvokeNavigationRequest |
✅ PASS | ShellSection.cs (+3) |
Good intermediate approach |
| 6 | try-fix (prior) | Synchronous Shell.Current?.Handler?.UpdateValue(TabBarIsVisibleProperty) after navigation and cleanup loop |
❌ FAIL | ShellSection.cs (+1) |
Same 0.81% mismatch; post-navigation approach fundamentally flawed |
| 7 | try-fix (prior) | SendDisappearing on ALL old pages + _navStack[0].SendAppearing() before InvokeNavigationRequest (bypasses Shell machinery) |
❌ FAIL | ShellSection.cs (+5/-5) |
0.81% mismatch; raw Page.Send* without Shell lifecycle machinery doesn't update tab bar |
| PR | PR #34403 | Full reorder: PresentedPageDisappearing() + PresentedPageAppearing() before InvokeNavigationRequest; add explanatory comment; skip duplicate SendDisappearing on top page in cleanup loop |
✅ PASS (Gate) | ShellSection.cs (+17/-3) |
Original PR; validated on iOS (prior) AND Android (this session) |
Exhausted: Yes (7 attempts from prior review; 4 passed, 3 failed; additional ideas were architectural refactors or variations of failed patterns)
Key Learning: The fix requires Shell lifecycle machinery (PresentedPageAppearing/CurrentItem.SendAppearing) to fire before InvokeNavigationRequest. Post-navigation UpdateValue approaches cannot override already-committed native platform state.
Selected Fix: PR's fix — most complete solution:
- Correctly handles both disappearing (
PresentedPageDisappearing) AND appearing (PresentedPageAppearing) lifecycle in correct order - Fixes the duplicate
SendDisappearingbug in the cleanup loop - Includes explanatory code comment documenting the intentional ordering
- Aligns multi-level pop behavior with single-level pop (
OnPopAsync) - Validated on Android (Gate this session) AND iOS (prior review Gate)
📋 Report — Final Recommendation
📝 Review Session — Fix-33351-Made changes to trigger page appearing events before platform navigation to ensure Shell TabBar visibility is applied correctly during multi-level back navigation. · fb538bf
✅ Final Recommendation: APPROVE
Summary
PR #34403 fixes a lifecycle timing bug in ShellSection.OnPopToRootAsync() where Shell.SetTabBarIsVisible() was silently ignored when navigating back multiple levels with GoToAsync("../.."). The fix correctly reorders lifecycle event calls so tab bar state is updated before the platform commits the native navigation. Tests were validated on Android (Gate this session: FAIL without fix / PASS with fix) and iOS (prior review Gate). Seven alternative fix approaches were explored — the PR's solution is the most complete.
Root Cause
In OnPopToRootAsync(), InvokeNavigationRequest(args) was called first, which synchronously triggers PopToRootViewController (iOS) / equivalent (Android). The platform reads tab-bar visibility at this moment. Only after the platform committed the navigation did PresentedPageAppearing() → OnAppearing() → Shell.SetTabBarIsVisible() fire — too late. This mismatch did not occur with single-level pop (GoToAsync("..")) because OnPopAsync already called PresentedPageAppearing() before InvokeNavigationRequest().
Fix Quality
The fix is correct and well-implemented:
- Moves
PresentedPageDisappearing()andPresentedPageAppearing()beforeInvokeNavigationRequest() - Avoids duplicate
SendDisappearingon the top page in the cleanup loop - Includes clear explanatory code comment documenting the intentional ordering
- Aligns multi-level pop behavior with single-level pop (
OnPopAsync)
Gate results:
- Android (this session): FAIL without fix ✅ | PASS with fix ✅
- iOS (prior review): FAIL without fix ✅ | PASS with fix ✅
Code Review Notes (Copilot Bot Observations)
These concerns from the Copilot automated review are worth noting but not blocking:
-
Lifecycle ordering of intermediate pages (
ShellSection.cs:875): After the fix, intermediate pages (e.g., Page 1 in a 3-page stack) receiveSendDisappearingAFTER the root page has receivedOnAppearing. This is the reverse of expected lifecycle ordering. The Copilot bot suggests firingSendDisappearingfor intermediate pages BEFOREPresentedPageAppearing()/InvokeNavigationRequest(). While this is a valid concern, it only affects apps that interact with intermediate pages'OnDisappearingin lifecycle-ordering-sensitive ways. This is an edge case and could be addressed as a follow-up. -
Test repro accuracy (
Issue33351.cs:42): The test sets tab bar visibility inShellContent.OnAppearing()(viaMyTab) rather than in the rootContentPage.OnAppearing()as described in the original issue. The test still correctly validates the timing fix, but an exact repro of the user-reported scenario would useContentPage.OnAppearing(). -
AutomationId for tab tap (
Issue33351.cs:21): The test taps "Tab 1" by visible text. Adding an explicitAutomationIdto the tab would improve test resilience. -
Screenshot timing (
Issue33351.cs:33):VerifyScreenshot()is called withoutretryTimeoutafter the pop-to-root animation. This could cause flakiness. ConsiderVerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2)).
These are code quality/test robustness suggestions. They do not invalidate the correctness of the fix.
Comparison with Alternatives (from prior try-fix exploration)
| Approach | Result | vs PR |
|---|---|---|
| PR's fix (full reorder + duplicate SendDisappearing fix) | ✅ PASS | — (baseline) |
Minimal: 2-line CurrentItem.SendAppearing() pre-navigation |
✅ PASS | Simpler but fires OnAppearing twice |
Clean reorder of PresentedPageAppearing only (no disappearing) |
✅ PASS | Doesn't handle disappearing side |
Post-navigation Dispatcher.Dispatch + UpdateValue |
❌ FAIL | Cannot override already-committed native state |
InvokeNavigationRequest then PresentedPageAppearing before await |
✅ PASS | Weaker ordering guarantee |
Bypass Shell machinery with raw Page.Send* calls |
❌ FAIL | Shell lifecycle machinery required |
The PR's fix is the most complete solution: correctly handles both sides of the lifecycle (disappearing AND appearing) and fixes the incidental duplicate SendDisappearing bug.
📋 Expand PR Finalization Review
Title: ✅ Good
Current: Fix for Shell tab visibility not updating when navigating back multiple pages
Description: ✅ Good
Description needs updates. See details below.
✨ Suggested PR Description
[!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!
Root Cause
In OnPopToRootAsync(), InvokeNavigationRequest() was called before PresentedPageAppearing(). This meant the platform committed the navigation UI immediately, before the root page's OnAppearing() was ever fired. Any Shell state changes made inside OnAppearing() — such as Shell.SetTabBarIsVisible() — arrived too late to affect the already-rendered navigation.
This timing mismatch only affected multi-level pop (GoToAsync("../..")). Single-level pop (GoToAsync("..")) already followed the correct order: PresentedPageAppearing() first, then InvokeNavigationRequest().
Description of Change
src/Controls/src/Core/Shell/ShellSection.cs
Reordered the execution sequence in OnPopToRootAsync() to match the existing single-level OnPopAsync() lifecycle contract:
Before:
InvokeNavigationRequest(args) ← platform commits UI immediately
... await completion ...
SendDisappearing() all pages
PresentedPageAppearing() ← too late, OnAppearing fires after UI is rendered
After:
PresentedPageDisappearing() ← fire disappearing on top page
PresentedPageAppearing() ← fire appearing on root page FIRST
InvokeNavigationRequest(args) ← platform reads updated Shell state when it commits
... await completion ...
SendDisappearing() intermediate pages only (top page already handled)
RemovePage() all pages
The loop cleanup was also refined: SendDisappearing() is now skipped for the top page (index oldStack.Count - 1) since it was already fired by PresentedPageDisappearing() earlier, preventing duplicate lifecycle events on the top page while still notifying all intermediate pages.
Issues Fixed
Fixes #33351
Platforms Tested
- Windows
- Mac
- iOS
- Android
Code Review: ⚠️ Issues Found
Code Review — PR #34403
✅ Looks Good
Core Fix Correctly Aligns with OnPopAsync Pattern
The existing OnPopAsync method already follows this order:
PresentedPageDisappearing();
_navStack.Remove(page);
PresentedPageAppearing();
InvokeNavigationRequest(args);The fix makes OnPopToRootAsync follow the same pattern:
PresentedPageDisappearing();
_navStack = new List<Page> { null }; // equivalent of removing pages from stack
PresentedPageAppearing();
InvokeNavigationRequest(args);This is an exact alignment with the single-level Pop lifecycle contract. ✅
Loop Guard Logic Is Correct
File: src/Controls/src/Core/Shell/ShellSection.cs
for (int i = 1; i < oldStack.Count; i++)
{
if (i < oldStack.Count - 1)
oldStack[i].SendDisappearing();
RemovePage(oldStack[i]);
}oldStack[0]isnull(the sentinel), so the loop starts at i=1.oldStack[oldStack.Count - 1]is the top page that was visible when pop was initiated — itsSendDisappearing()was already fired byPresentedPageDisappearing()earlier.- Intermediate pages (i=1 to i=oldStack.Count-2) correctly get
SendDisappearing(). RemovePageis called for all pages regardless. ✅
Inline Comments Are Thorough
Both changed regions include explanatory comments documenting the intent (avoiding double lifecycle events, matching single-level pop behavior). This is important for a non-obvious ordering change. ✅
Test Coverage Is Solid
- HostApp page (
Issue33351.cs): Uses a customMyTab : ShellContentthat hides the tab bar on any navigation event and restores it inOnAppearing(). This precisely reproduces the reported pattern. - Test (
Issue33351.cs): Navigates two levels deep (Page1 → Page2), pops to root viaGoToAsync("../.."), waits for the root page element, and does a screenshot comparison. - Snapshots provided for all 4 platforms: Android, Mac, iOS, iOS-26, Windows. ✅
🟡 Suggestions
1. Empty Output Table in Description
File: PR description body
The ### Output section contains a Before/After table with empty cells:
Before Issue Fix | After Issue Fix |
|----------|----------|
|||
This should either be removed or populated with actual screenshots. Empty table cells make the PR description look incomplete.
Recommendation: Remove the Output section or add the captured screenshots.
2. Test: App.WaitForElement("Tab 1") May Be Fragile
File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33351.cs
App.WaitForElement("Tab 1");
App.Tap("Tab 1");The test waits for and taps "Tab 1" by text label rather than an AutomationId. In the HostApp, "Tab 1" is the tab's Title property (not an AutomationId). This is a common pattern for tab navigation in existing Shell tests, so it likely works, but using an explicit AutomationId on the tab would be more robust.
Recommendation: Low priority — if existing Shell tests use the same convention, this is acceptable. No code change required.
3. Test: No Explicit Tab Bar Visibility Check Beyond Screenshot
File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33351.cs
The test verifies tab bar visibility only via VerifyScreenshot(). There is no programmatic assertion checking that the tab bar element is visible/accessible. This is acceptable given WaitForElement("TabBarVisibleLabel") confirms the root page is shown, and the screenshot compares the full visual state.
Recommendation: No change needed, but a future improvement could add an explicit tab bar element check if screenshot comparisons are flaky across OS versions.
🔴 Critical Issues
None.
|
Hi @BagavathiPerumal I guess something got broken here #34280 , so you opened a new pr right? Did you change anything or just copy paste everything |
Yes @kubaflo, a new PR was opened because the previous PR contained some unintended code changes that were introduced during the rebase process. To avoid confusion and keep the history clean, the PR was recreated. The changes were not simply copy-pasted. The updates from the previous PR were retained, and the AI review comments have also been addressed. Specifically:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a Shell lifecycle timing issue where tab bar visibility updates (commonly triggered from OnAppearing) could be ignored when navigating back multiple pages via GoToAsync("../..") (PopToRoot), by reordering the PopToRoot lifecycle sequence to align more closely with single-page Pop behavior. It also adds a UI test and baseline snapshots to prevent regressions across platforms.
Changes:
- Reorders
ShellSection.OnPopToRootAsyncto fire appearing lifecycle events before invoking the platform navigation request, and avoids duplicate disappearing for the top page. - Adds a new Appium UITest for issue #33351 plus HostApp reproduction page.
- Adds new screenshot baselines for Android/iOS/Mac/WinUI test projects.
Reviewed changes
Copilot reviewed 3 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Controls/src/Core/Shell/ShellSection.cs | Adjusts PopToRoot lifecycle ordering and disappearing behavior. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue33351.cs | Adds HostApp repro Shell/page structure for the issue scenario. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33351.cs | Adds Appium UITest that navigates and verifies tab bar visibility via screenshot. |
| src/Controls/tests/TestCases.Android.Tests/snapshots/android/TabBarVisibilityAfterMultiLevelPopToRoot.png | New Android baseline screenshot. |
| src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/TabBarVisibilityAfterMultiLevelPopToRoot.png | New iOS baseline screenshot. |
| src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/TabBarVisibilityAfterMultiLevelPopToRoot.png | New Mac baseline screenshot. |
| src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/TabBarVisibilityAfterMultiLevelPopToRoot.png | New Windows baseline screenshot. |
|
/azp run maui-pr-uitests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…le pages (#34403) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Root cause The issue occurs because of the navigation sequence used in OnPopToRootAsync() where the platform navigation is triggered before the root page’s lifecycle events are fired. When Shell.Current.GoToAsync("../..") is used, the method InvokeNavigationRequest() executes first, which sends the navigation request to the native platform handlers. The platform then commits the UI changes immediately. Only after this process, the root page’s OnAppearing() method is called. Since Shell.SetTabBarIsVisible() is typically invoked inside OnAppearing(), it runs too late, after the UI has already been rendered, causing the TabBar visibility change to be ignored. This timing mismatch does not occur with single-level navigation (GoToAsync("..")) because that flow correctly triggers lifecycle events before the platform navigation begins. ### Description of Issue Fix The fix involves reordering the execution sequence within OnPopToRootAsync() so that PresentedPageAppearing() runs before InvokeNavigationRequest(), ensuring OnAppearing() is triggered early enough for updates such as Shell.SetTabBarIsVisible() to be applied before the platform finalizes the navigation UI. Additionally, the stack cleanup loop was refined to skip calling SendDisappearing() on the top page since it is already handled by PresentedPageDisappearing(), thereby avoiding duplicate lifecycle events while still notifying intermediate pages. This change aligns multi level pop to root behavior with single level pop, providing consistent lifecycle handling without introducing breaking changes. Tested the behavior in the following platforms. - [x] Windows - [x] Mac - [x] iOS - [x] Android ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #33351 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> ### Output Before Issue Fix | After Issue Fix | |----------|----------| |<video width="100" height="100" alt="Before Fix" src="https://github.com/user-attachments/assets/d932197b-5ef7-4450-a0a6-5326ff43f4c5">|<video width="100" height="100" alt="After Fix" src="https://github.com/user-attachments/assets/5b2da04a-191f-412d-874e-339392409592">| --------- Co-authored-by: Shane Neuville <5375137+PureWeen@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Ing. Jorge Perales Díaz <slipknot_jpd@hotmail.com> Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com> Co-authored-by: Sven Boemer <sbomer@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Tamilarasan-Paranthaman <Tamilarasan-Paranthaman@users.noreply.github.com>
…le pages (#34403) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Root cause The issue occurs because of the navigation sequence used in OnPopToRootAsync() where the platform navigation is triggered before the root page’s lifecycle events are fired. When Shell.Current.GoToAsync("../..") is used, the method InvokeNavigationRequest() executes first, which sends the navigation request to the native platform handlers. The platform then commits the UI changes immediately. Only after this process, the root page’s OnAppearing() method is called. Since Shell.SetTabBarIsVisible() is typically invoked inside OnAppearing(), it runs too late, after the UI has already been rendered, causing the TabBar visibility change to be ignored. This timing mismatch does not occur with single-level navigation (GoToAsync("..")) because that flow correctly triggers lifecycle events before the platform navigation begins. ### Description of Issue Fix The fix involves reordering the execution sequence within OnPopToRootAsync() so that PresentedPageAppearing() runs before InvokeNavigationRequest(), ensuring OnAppearing() is triggered early enough for updates such as Shell.SetTabBarIsVisible() to be applied before the platform finalizes the navigation UI. Additionally, the stack cleanup loop was refined to skip calling SendDisappearing() on the top page since it is already handled by PresentedPageDisappearing(), thereby avoiding duplicate lifecycle events while still notifying intermediate pages. This change aligns multi level pop to root behavior with single level pop, providing consistent lifecycle handling without introducing breaking changes. Tested the behavior in the following platforms. - [x] Windows - [x] Mac - [x] iOS - [x] Android ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #33351 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> ### Output Before Issue Fix | After Issue Fix | |----------|----------| |<video width="100" height="100" alt="Before Fix" src="https://github.com/user-attachments/assets/d932197b-5ef7-4450-a0a6-5326ff43f4c5">|<video width="100" height="100" alt="After Fix" src="https://github.com/user-attachments/assets/5b2da04a-191f-412d-874e-339392409592">| --------- Co-authored-by: Shane Neuville <5375137+PureWeen@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Ing. Jorge Perales Díaz <slipknot_jpd@hotmail.com> Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com> Co-authored-by: Sven Boemer <sbomer@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Tamilarasan-Paranthaman <Tamilarasan-Paranthaman@users.noreply.github.com>
…le pages (#34403) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Root cause The issue occurs because of the navigation sequence used in OnPopToRootAsync() where the platform navigation is triggered before the root page’s lifecycle events are fired. When Shell.Current.GoToAsync("../..") is used, the method InvokeNavigationRequest() executes first, which sends the navigation request to the native platform handlers. The platform then commits the UI changes immediately. Only after this process, the root page’s OnAppearing() method is called. Since Shell.SetTabBarIsVisible() is typically invoked inside OnAppearing(), it runs too late, after the UI has already been rendered, causing the TabBar visibility change to be ignored. This timing mismatch does not occur with single-level navigation (GoToAsync("..")) because that flow correctly triggers lifecycle events before the platform navigation begins. ### Description of Issue Fix The fix involves reordering the execution sequence within OnPopToRootAsync() so that PresentedPageAppearing() runs before InvokeNavigationRequest(), ensuring OnAppearing() is triggered early enough for updates such as Shell.SetTabBarIsVisible() to be applied before the platform finalizes the navigation UI. Additionally, the stack cleanup loop was refined to skip calling SendDisappearing() on the top page since it is already handled by PresentedPageDisappearing(), thereby avoiding duplicate lifecycle events while still notifying intermediate pages. This change aligns multi level pop to root behavior with single level pop, providing consistent lifecycle handling without introducing breaking changes. Tested the behavior in the following platforms. - [x] Windows - [x] Mac - [x] iOS - [x] Android ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #33351 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> ### Output Before Issue Fix | After Issue Fix | |----------|----------| |<video width="100" height="100" alt="Before Fix" src="https://github.com/user-attachments/assets/d932197b-5ef7-4450-a0a6-5326ff43f4c5">|<video width="100" height="100" alt="After Fix" src="https://github.com/user-attachments/assets/5b2da04a-191f-412d-874e-339392409592">| --------- Co-authored-by: Shane Neuville <5375137+PureWeen@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Ing. Jorge Perales Díaz <slipknot_jpd@hotmail.com> Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com> Co-authored-by: Sven Boemer <sbomer@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Tamilarasan-Paranthaman <Tamilarasan-Paranthaman@users.noreply.github.com>
…le pages (#34403) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Root cause The issue occurs because of the navigation sequence used in OnPopToRootAsync() where the platform navigation is triggered before the root page’s lifecycle events are fired. When Shell.Current.GoToAsync("../..") is used, the method InvokeNavigationRequest() executes first, which sends the navigation request to the native platform handlers. The platform then commits the UI changes immediately. Only after this process, the root page’s OnAppearing() method is called. Since Shell.SetTabBarIsVisible() is typically invoked inside OnAppearing(), it runs too late, after the UI has already been rendered, causing the TabBar visibility change to be ignored. This timing mismatch does not occur with single-level navigation (GoToAsync("..")) because that flow correctly triggers lifecycle events before the platform navigation begins. ### Description of Issue Fix The fix involves reordering the execution sequence within OnPopToRootAsync() so that PresentedPageAppearing() runs before InvokeNavigationRequest(), ensuring OnAppearing() is triggered early enough for updates such as Shell.SetTabBarIsVisible() to be applied before the platform finalizes the navigation UI. Additionally, the stack cleanup loop was refined to skip calling SendDisappearing() on the top page since it is already handled by PresentedPageDisappearing(), thereby avoiding duplicate lifecycle events while still notifying intermediate pages. This change aligns multi level pop to root behavior with single level pop, providing consistent lifecycle handling without introducing breaking changes. Tested the behavior in the following platforms. - [x] Windows - [x] Mac - [x] iOS - [x] Android ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #33351 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> ### Output Before Issue Fix | After Issue Fix | |----------|----------| |<video width="100" height="100" alt="Before Fix" src="https://github.com/user-attachments/assets/d932197b-5ef7-4450-a0a6-5326ff43f4c5">|<video width="100" height="100" alt="After Fix" src="https://github.com/user-attachments/assets/5b2da04a-191f-412d-874e-339392409592">| --------- Co-authored-by: Shane Neuville <5375137+PureWeen@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Ing. Jorge Perales Díaz <slipknot_jpd@hotmail.com> Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com> Co-authored-by: Sven Boemer <sbomer@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Tamilarasan-Paranthaman <Tamilarasan-Paranthaman@users.noreply.github.com>
…le pages (#34403) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Root cause The issue occurs because of the navigation sequence used in OnPopToRootAsync() where the platform navigation is triggered before the root page’s lifecycle events are fired. When Shell.Current.GoToAsync("../..") is used, the method InvokeNavigationRequest() executes first, which sends the navigation request to the native platform handlers. The platform then commits the UI changes immediately. Only after this process, the root page’s OnAppearing() method is called. Since Shell.SetTabBarIsVisible() is typically invoked inside OnAppearing(), it runs too late, after the UI has already been rendered, causing the TabBar visibility change to be ignored. This timing mismatch does not occur with single-level navigation (GoToAsync("..")) because that flow correctly triggers lifecycle events before the platform navigation begins. ### Description of Issue Fix The fix involves reordering the execution sequence within OnPopToRootAsync() so that PresentedPageAppearing() runs before InvokeNavigationRequest(), ensuring OnAppearing() is triggered early enough for updates such as Shell.SetTabBarIsVisible() to be applied before the platform finalizes the navigation UI. Additionally, the stack cleanup loop was refined to skip calling SendDisappearing() on the top page since it is already handled by PresentedPageDisappearing(), thereby avoiding duplicate lifecycle events while still notifying intermediate pages. This change aligns multi level pop to root behavior with single level pop, providing consistent lifecycle handling without introducing breaking changes. Tested the behavior in the following platforms. - [x] Windows - [x] Mac - [x] iOS - [x] Android ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #33351 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> ### Output Before Issue Fix | After Issue Fix | |----------|----------| |<video width="100" height="100" alt="Before Fix" src="https://github.com/user-attachments/assets/d932197b-5ef7-4450-a0a6-5326ff43f4c5">|<video width="100" height="100" alt="After Fix" src="https://github.com/user-attachments/assets/5b2da04a-191f-412d-874e-339392409592">| --------- Co-authored-by: Shane Neuville <5375137+PureWeen@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Ing. Jorge Perales Díaz <slipknot_jpd@hotmail.com> Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com> Co-authored-by: Sven Boemer <sbomer@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Tamilarasan-Paranthaman <Tamilarasan-Paranthaman@users.noreply.github.com>
## What's Coming .NET MAUI inflight/candidate introduces significant improvements across all platforms with focus on quality, performance, and developer experience. This release includes 66 commits with various improvements, bug fixes, and enhancements. ## Activityindicator - [Android] Implemented material3 support for ActivityIndicator by @Dhivya-SF4094 in #33481 <details> <summary>🔧 Fixes</summary> - [Implement material3 support for ActivityIndicator](#33479) </details> - [iOS] Fix: ActivityIndicator IsRunning ignores IsVisible when set to true by @bhavanesh2001 in #28983 <details> <summary>🔧 Fixes</summary> - [[iOS] [ActivityIndicator] `IsRunning` ignores `IsVisible` when set to `true`](#28968) </details> ## Button - [iOS] Button RTL text and image overlap - fix by @kubaflo in #29041 ## Checkbox - [iOS/MacCatalyst] Fix CheckBox foreground color not resetting when set to null by @Ahamed-Ali in #34284 <details> <summary>🔧 Fixes</summary> - [[iOS] Color of the checkBox control is not properly worked on dynamic scenarios](#34278) </details> ## CollectionView - [iOS] Fix: CollectionView does not clear selection when SelectedItem is set to null by @Tamilarasan-Paranthaman in #30420 <details> <summary>🔧 Fixes</summary> - [CollectionView not being able to remove selected item highlight on iOS](#30363) - [[MAUI] Select items traces are preserved](#26187) </details> - [iOS] CV2 ItemsLayout update by @kubaflo in #28675 <details> <summary>🔧 Fixes</summary> - [CollectionView CollectionViewHandler2 doesnt change ItemsLayout on DataTrigger](#28656) - [iOS CollectionView doesn't respect a change to ItemsLayout when using Items2.CollectionViewHandler2](#31259) </details> - [iOS][CV2] Fix CollectionView renders large empty space at bottom of view by @devanathan-vaithiyanathan in #31215 <details> <summary>🔧 Fixes</summary> - [[iOS] [MacCatalyst] CollectionView renders large empty space at bottom of view](#17799) - [[iOS/Mac] CollectionView2 EmptyView takes up large horizontal space even when the content is small](#33201) </details> - [iOS] Fixed issue where group Header/Footer template was set to all items when IsGrouped was true for an ObservableCollection by @Tamilarasan-Paranthaman in #29144 <details> <summary>🔧 Fixes</summary> - [[iOS] Group Header/Footer Repeated for All Items When IsGrouped is True for ObservableCollection in CollectionView](#29141) </details> - [Android] Fix CollectionView selection crash with HeaderTemplate by @NirmalKumarYuvaraj in #34275 <details> <summary>🔧 Fixes</summary> - [[Bug] [Android] System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index](#34247) </details> ## DateTimePicker - [iOS] Fix TimePicker AM/PM frequently changes when the app is closed and reopened by @devanathan-vaithiyanathan in #31066 <details> <summary>🔧 Fixes</summary> - [[iOS] TimePicker AM/PM frequently changes when the app is closed and reopened](#30837) - [Maui 10 iOS TimePicker Strange Characters in place of AM/PM](#33722) </details> - Android TimePicker ignores 24 hour system setting when using Format Property - fix by @kubaflo in #28797 <details> <summary>🔧 Fixes</summary> - [Android TimePicker ignores 24 hour system setting when using Format Property](#28784) </details> ## Drawing - [iOS, Mac, Windows] GraphicsView: Fix Background/BackgroundColor not updating by @NirmalKumarYuvaraj in #31254 <details> <summary>🔧 Fixes</summary> - [[iOS, Mac, Windows] GraphicsView does not change the Background/BackgroundColor](#31239) </details> - [iOS] GraphicsView DrawString - fix by @kubaflo in #26304 <details> <summary>🔧 Fixes</summary> - [DrawString not rendering in iOS.](#24450) - [GraphicsView DrawString not rendering in iOS](#8486) - [DrawString doesn't work on maccatalyst](#4993) </details> - [Android] - Fix Shadow Rendering For Transparent Fill, Stroke (Lines), and Text on Shapes by @prakashKannanSf3972 in #29528 <details> <summary>🔧 Fixes</summary> - [Ellipse Transparency Not Rendered When Drawing Arc Inside the Ellipse Using GraphicsView on Android](#29394) </details> - Revert "[iOS, Mac, Windows] GraphicsView: Fix Background/BackgroundColor not updating (#31254)" by @Ahamed-Ali via @Copilot in #34508 ## Entry - [iOS 26] Fix Entry MaxLength not enforced due to new multi-range delegate by @kubaflo in #32045 <details> <summary>🔧 Fixes</summary> - [iOS 26 - The MaxLength property value is not respected on an Entry control.](#32016) - [.NET MAUI Entry Maximum Length not working on iOS and macOS](#33316) </details> - [iOS] Fixed Entry with IsPassword toggling loses previously entered text by @SubhikshaSf4851 in #30572 <details> <summary>🔧 Fixes</summary> - [Entry with IsPassword toggling loses previously entered text on iOS when IsPassword is re-enabled](#30085) </details> ## Essentials - Fix for FilePicker PickMultipleAsync nullable reference type by @SuthiYuvaraj in #33163 <details> <summary>🔧 Fixes</summary> - [FilePicker PickMultipleAsync nullable reference type](#33114) </details> - Replace deprecated NetworkReachability with NWPathMonitor on iOS/macOS by @jfversluis via @Copilot in #32354 <details> <summary>🔧 Fixes</summary> - [NetworkReachability is obsolete on iOS/maccatalyst 17.4+](#32312) - [Use NWPathMonitor on iOS for Essentials Connectivity](#2574) </details> ## Essentials Connectivity - Update Android Connectivity implementation to use modern APIs by @jfversluis via @Copilot in #30348 <details> <summary>🔧 Fixes</summary> - [Update the Android Connectivity implementation to user modern APIs](#30347) </details> ## Flyout - [iOS] Fixed Flyout icon not updating when root page changes using InsertPageBefore by @Vignesh-SF3580 in #29924 <details> <summary>🔧 Fixes</summary> - [[iOS] Flyout icon not replaced by back button when root page is changed using InsertPageBefore](#29921) </details> ## Flyoutpage - [iOS] Flyout Items Not Displayed in RightToLeft FlowDirection in Landscape - fix by @kubaflo in #26762 <details> <summary>🔧 Fixes</summary> - [Flyout Items Not Displayed in RightToLeft FlowDirection on iOS in Landscape Orientation and Hamburger Icon Positioned Incorrectly](#26726) </details> ## Image - [Android] Implemented Material3 support for Image by @Dhivya-SF4094 in #33661 <details> <summary>🔧 Fixes</summary> - [Implement Material3 support for Image](#33660) </details> ## Keyboard - [iOS] Fix gap at top of view after rotating device while Entry keyboard is visible by @praveenkumarkarunanithi in #34328 <details> <summary>🔧 Fixes</summary> - [Focusing and entering texts on entry control causes a gap at the top after rotating simulator.](#33407) </details> ## Label - [Android] Support for images inside HTML label by @kubaflo in #21679 <details> <summary>🔧 Fixes</summary> - [Label with HTML TextType does not display images on Android](#21044) </details> - [fix] ContentLabel Moved to a nested class to prevent CS0122 in external source generators by @SubhikshaSf4851 in #34514 <details> <summary>🔧 Fixes</summary> - [[MAUI] Building Maui App with sample content results CS0122 errors.](#34512) </details> ## Layout - Optimize ordering of children in Flex layout by @symbiogenesis in #21961 - [Android] Fix control size properties not available during Loaded event by @Vignesh-SF3580 in #31590 <details> <summary>🔧 Fixes</summary> - [CollectionView on Android does not provide height, width, logical children once loaded, works fine on Windows](#14364) - [Control's Loaded event invokes before calling its measure override method.](#14160) </details> ## Mediapicker - [iOS/Android] MediaPicker: Fix image orientation when RotateImage=true by @michalpobuta in #33892 <details> <summary>🔧 Fixes</summary> - [MediaPicker.PickPhotosAsync does not preserve image orientation](#32650) </details> ## Modal - [Windows] Fix modal page keyboard focus not shifting to newly opened modal by @jfversluis in #34212 <details> <summary>🔧 Fixes</summary> - [Keyboard focus does not shift to a newly opened modal page: Pressing enter clicks the button on the page beneath the modal page](#22938) </details> ## Navigation - [iOS26] Apply view margins in title view by @kubaflo in #32205 <details> <summary>🔧 Fixes</summary> - [NavigationPage TitleView iOS 26](#32200) </details> - [iOS] System.NullReferenceException at NavigationRenderer.SetStatusBarStyle() by @kubaflo in #29564 <details> <summary>🔧 Fixes</summary> - [System.NullReferenceException at NavigationRenderer.SetStatusBarStyle()](#29535) </details> - [iOS 26] Fix back button color not applied for NavigationPage by @Shalini-Ashokan in #34326 <details> <summary>🔧 Fixes</summary> - [[iOS] Color not applied to the Back button text or image on iOS 26](#33966) </details> ## Picker - Fix Picker layout on Mac Catalyst 26+ by @kubaflo in #33146 <details> <summary>🔧 Fixes</summary> - [[MacOS 26] Text on picker options are not centered on macOS 26.1](#33229) </details> ## Progressbar - [Android] Implemented Material3 support for ProgressBar by @SyedAbdulAzeemSF4852 in #33926 <details> <summary>🔧 Fixes</summary> - [Implement Material3 support for Progressbar](#33925) </details> ## RadioButton - [iOS, Mac] Fix for RadioButton TextColor for plain Content not working by @HarishwaranVijayakumar in #31940 <details> <summary>🔧 Fixes</summary> - [RadioButton: TextColor for plain Content not working on iOS](#18011) </details> - [All Platforms] Fix RadioButton warning when ControlTemplate is set with View content by @kubaflo in #33839 <details> <summary>🔧 Fixes</summary> - [Seeking clarification on RadioButton + ControlTemplate + Content documentation](#33829) </details> - Visual state change for disabled RadioButton by @kubaflo in #23471 <details> <summary>🔧 Fixes</summary> - [RadioButton disabled UI issue - iOS](#18668) </details> ## SafeArea - [Android] Fix for TabbedPage BottomNavigation BarBackgroundColor not extending to system navigation bar by @praveenkumarkarunanithi in #33428 <details> <summary>🔧 Fixes</summary> - [[Android] TabbedPage BottomNavigation BarBackgroundColor does not extend to system navigation bar area in Edge-to-Edge mode](#33344) </details> ## ScrollView - [Android] ScrollView: Fix HorizontalScrollBarVisibility not updating immediately at runtime by @SubhikshaSf4851 in #33528 <details> <summary>🔧 Fixes</summary> - [Runtime Scrollbar visibility not updating correctly on Android and macOS platforms.](#33400) </details> - Fixed crash when calling ItemsView.ScrollTo on unloaded CollectionView by @kubaflo in #25444 <details> <summary>🔧 Fixes</summary> - [App crashes when calling ItemsView.ScrollTo on unloaded CollectionView](#23014) </details> ## Shell - [Shell] Update logic for iOS large title display in ShellItemRenderer by @kubaflo in #33246 - [iOS][Shell] Fix navigation lifecycle and back button for More tab (>5 tabs) by @kubaflo in #27932 <details> <summary>🔧 Fixes</summary> - [OnAppearing and OnNavigatedTo does not work when using extended Tabbar (tabbar with more than 5 tabs) on IOS.](#27799) - [Shell.BackButtonBehavior does not work when using extended Tabbar (tabbar with more than 5 tabs)on IOS.](#27800) - [Shell TabBar More button causes ViewModel command binding disconnection on back navigation](#30862) - [Content page onappearing not firing if tabs are on the more tab on IOS](#31166) </details> - [iOS 26] Fix tab bar ghosting when navigating from modal to tabbed Shell content by @SubhikshaSf4851 in #34254 <details> <summary>🔧 Fixes</summary> - [[iOS] Tab bar ghosting issue on iOS 26 (liquid glass)](#34143) </details> - Fix for Shell tab visibility not updating when navigating back multiple pages by @BagavathiPerumal in #34403 <details> <summary>🔧 Fixes</summary> - [Changing Shell Tab Visibility when navigating back multiple pages ignores Shell Tab Visibility](#33351) </details> - [iOS/Mac] Fixed OnBackButtonPressed not firing for Shell Navigation Bar Button by @Dhivya-SF4094 in #34401 <details> <summary>🔧 Fixes</summary> - [[iOS] OnBackButtonPressed not firing for Shell Navigation Bar button](#34190) </details> ## Slider - [iOS] Fix for Slider ThumbImageSource is not centered properly on iOS 26 by @HarishwaranVijayakumar in #34019 <details> <summary>🔧 Fixes</summary> - [[iOS 26] Slider ThumbImageSource is not centered properly](#33967) </details> - [Android] Fix improper rendering of ThumbimageSource in Slider by @NirmalKumarYuvaraj in #34064 <details> <summary>🔧 Fixes</summary> - [[Slider] MAUI Slider thumb image is big on android](#13258) </details> ## Stepper - [iOS] Fix Stepper layout overlap in landscape on iOS 26 by @Vignesh-SF3580 in #34325 <details> <summary>🔧 Fixes</summary> - [[.NET10] D10 - Customize cursor position - Rotating simulator makes the button and label overlap](#34273) </details> ## SwipeView - [iOS] SwipeView: Honor FontImageSource.Color in SwipeItem icon by @kubaflo in #27389 <details> <summary>🔧 Fixes</summary> - [[iOS] SwipeView: SwipeItem.IconImageSource.FontImageSource color value not honored](#27377) </details> ## Switch - [Android] Fix Switch thumb shadow missing when ThumbColor is set by @Shalini-Ashokan in #33960 <details> <summary>🔧 Fixes</summary> - [Android Switch Control Thumb Shadow](#19676) </details> ## Toolbar - [iOS/Mac Catalyst 26] Fix Shell.ForegroundColor not applied to ToolbarItems by @SyedAbdulAzeemSF4852 in #34085 <details> <summary>🔧 Fixes</summary> - [[iOS26] Shell.ForegroundColor is not applied to ToolbarItems](#34083) </details> - [Android] VoiceOver on Toolbar Item by @kubaflo in #29596 <details> <summary>🔧 Fixes</summary> - [VoiceOver on Toolbar Item](#29573) - [SemanticProperties do not work on ToolbarItems](#23623) </details> <details> <summary>🧪 Testing (11)</summary> - [Testing] Additional Feature Matrix Test Cases for CollectionView by @TamilarasanSF4853 in #32432 - [Testing] Feature Matrix UITest Cases for VisualStateManager by @LogishaSelvarajSF4525 in #34146 - [Testing] Feature Matrix UITest Cases for Clip by @TamilarasanSF4853 in #34121 - [Testing] Feature matrix UITest Cases for Map Control by @HarishKumarSF4517 in #31656 - [Testing] Feature matrix UITest Cases for Visual Transform Control by @HarishKumarSF4517 in #32799 - [Testing] Feature Matrix UITest Cases for Shell Pages by @NafeelaNazhir in #33945 - [Testing] Feature Matrix UITest Cases for Triggers by @HarishKumarSF4517 in #34152 - [Testing] Refactoring Feature Matrix UITest Cases for CheckBox Control by @LogishaSelvarajSF4525 in #34283 - Resolve UI test Build Sample failures - Candidate March 16 by @Ahamed-Ali in #34442 - Fix the failures in the Candidate branch- March 16 by @Ahamed-Ali in #34453 <details> <summary>🔧 Fixes</summary> - [March 16th, Candidate](#34437) </details> - Fixed the iOS 18.5 Candidate failures (March 16,2026) by @Ahamed-Ali in #34593 <details> <summary>🔧 Fixes</summary> - [March 16th, Candidate](#34437) </details> </details> <details> <summary>📦 Other (2)</summary> - Fixed candidate test failures caused by PR #33428. by @Ahamed-Ali in #34515 <details> <summary>🔧 Fixes</summary> - [[.NET10] On Android, there's a big space at the top for I, M and N2 & N3](#34509) </details> - Revert "[iOS] Button RTL text and image overlap - fix (#29041)" in b0497af </details> <details> <summary>📝 Issue References</summary> Fixes #2574, Fixes #4993, Fixes #8486, Fixes #13258, Fixes #14160, Fixes #14364, Fixes #17799, Fixes #18011, Fixes #18668, Fixes #19676, Fixes #21044, Fixes #22938, Fixes #23014, Fixes #23623, Fixes #24450, Fixes #26187, Fixes #26726, Fixes #27377, Fixes #27799, Fixes #27800, Fixes #28656, Fixes #28784, Fixes #28968, Fixes #29141, Fixes #29394, Fixes #29535, Fixes #29573, Fixes #29921, Fixes #30085, Fixes #30347, Fixes #30363, Fixes #30837, Fixes #30862, Fixes #31166, Fixes #31239, Fixes #31259, Fixes #32016, Fixes #32200, Fixes #32312, Fixes #32650, Fixes #33114, Fixes #33201, Fixes #33229, Fixes #33316, Fixes #33344, Fixes #33351, Fixes #33400, Fixes #33407, Fixes #33479, Fixes #33660, Fixes #33722, Fixes #33829, Fixes #33925, Fixes #33966, Fixes #33967, Fixes #34083, Fixes #34143, Fixes #34190, Fixes #34247, Fixes #34273, Fixes #34278, Fixes #34437, Fixes #34509, Fixes #34512 </details> **Full Changelog**: main...inflight/candidate
…le pages (dotnet#34403) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Root cause The issue occurs because of the navigation sequence used in OnPopToRootAsync() where the platform navigation is triggered before the root page’s lifecycle events are fired. When Shell.Current.GoToAsync("../..") is used, the method InvokeNavigationRequest() executes first, which sends the navigation request to the native platform handlers. The platform then commits the UI changes immediately. Only after this process, the root page’s OnAppearing() method is called. Since Shell.SetTabBarIsVisible() is typically invoked inside OnAppearing(), it runs too late, after the UI has already been rendered, causing the TabBar visibility change to be ignored. This timing mismatch does not occur with single-level navigation (GoToAsync("..")) because that flow correctly triggers lifecycle events before the platform navigation begins. ### Description of Issue Fix The fix involves reordering the execution sequence within OnPopToRootAsync() so that PresentedPageAppearing() runs before InvokeNavigationRequest(), ensuring OnAppearing() is triggered early enough for updates such as Shell.SetTabBarIsVisible() to be applied before the platform finalizes the navigation UI. Additionally, the stack cleanup loop was refined to skip calling SendDisappearing() on the top page since it is already handled by PresentedPageDisappearing(), thereby avoiding duplicate lifecycle events while still notifying intermediate pages. This change aligns multi level pop to root behavior with single level pop, providing consistent lifecycle handling without introducing breaking changes. Tested the behavior in the following platforms. - [x] Windows - [x] Mac - [x] iOS - [x] Android ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#33351 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> ### Output Before Issue Fix | After Issue Fix | |----------|----------| |<video width="100" height="100" alt="Before Fix" src="https://github.com/user-attachments/assets/d932197b-5ef7-4450-a0a6-5326ff43f4c5">|<video width="100" height="100" alt="After Fix" src="https://github.com/user-attachments/assets/5b2da04a-191f-412d-874e-339392409592">| --------- Co-authored-by: Shane Neuville <5375137+PureWeen@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Ing. Jorge Perales Díaz <slipknot_jpd@hotmail.com> Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com> Co-authored-by: Sven Boemer <sbomer@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Tamilarasan-Paranthaman <Tamilarasan-Paranthaman@users.noreply.github.com>
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!
Root cause
The issue occurs because of the navigation sequence used in OnPopToRootAsync() where the platform navigation is triggered before the root page’s lifecycle events are fired. When Shell.Current.GoToAsync("../..") is used, the method InvokeNavigationRequest() executes first, which sends the navigation request to the native platform handlers.
The platform then commits the UI changes immediately. Only after this process, the root page’s OnAppearing() method is called. Since Shell.SetTabBarIsVisible() is typically invoked inside OnAppearing(), it runs too late, after the UI has already been rendered, causing the TabBar visibility change to be ignored.
This timing mismatch does not occur with single-level navigation (GoToAsync("..")) because that flow correctly triggers lifecycle events before the platform navigation begins.
Description of Issue Fix
The fix involves reordering the execution sequence within OnPopToRootAsync() so that PresentedPageAppearing() runs before InvokeNavigationRequest(), ensuring OnAppearing() is triggered early enough for updates such as Shell.SetTabBarIsVisible() to be applied before the platform finalizes the navigation UI.
Additionally, the stack cleanup loop was refined to skip calling SendDisappearing() on the top page since it is already handled by PresentedPageDisappearing(), thereby avoiding duplicate lifecycle events while still notifying intermediate pages. This change aligns multi level pop to root behavior with single level pop, providing consistent lifecycle handling without introducing breaking changes.
Tested the behavior in the following platforms.
Issues Fixed
Fixes #33351
Output
33351-BeforeFix.mov
33351-AfterFix.mov