[Android] Fix OnBackButtonPressed not invoked for Shell#35150
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35150Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35150" |
🤖 AI Summary
📊 Review Session —
|
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🖥️ Issue9095 Issue9095 |
✅ PASS — 560s |
🔴 Without fix — 🖥️ Issue9095: ⚠️ ENV ERROR · 1752s
(truncated to last 15,000 chars)
n.Debugging.targets(333,5): error ADB0010: [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass105_0.<InstallPackage>b__0(Task`1 t) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: --- End of stack trace from previous location --- [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: --- End of stack trace from previous location --- [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at AndroidDeviceExtensions.PushAndInstallPackageAsync(AndroidDevice device, PushAndInstallCommand command, CancellationToken token) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at AndroidDeviceExtensions.PushAndInstallPackageAsync(AndroidDevice device, PushAndInstallCommand command, CancellationToken token) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Xamarin.Android.Tasks.FastDeploy.RunInstall() [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
0 Warning(s)
1 Error(s)
Time Elapsed 00:16:06.27
* daemon not running; starting now at tcp:5037
* daemon started successfully
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:08:57.82
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Determining projects to restore...
Restored /home/vsts/work/1/s/src/Controls/tests/CustomAttributes/Controls.CustomAttributes.csproj (in 1.35 sec).
Restored /home/vsts/work/1/s/src/TestUtils/src/VisualTestUtils/VisualTestUtils.csproj (in 7 ms).
Restored /home/vsts/work/1/s/src/TestUtils/src/VisualTestUtils.MagickNet/VisualTestUtils.MagickNet.csproj (in 4.41 sec).
Restored /home/vsts/work/1/s/src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj (in 6 sec).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Core/UITest.Core.csproj (in 2 ms).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj (in 2 ms).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.NUnit/UITest.NUnit.csproj (in 537 ms).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj (in 1.65 sec).
5 of 13 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.11] Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.48] Discovered: Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
NUnit3TestExecutor discovered 2 of 2 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 04/27/2026 12:42:12 ShellOnBackButtonPressedReturnFalseShouldNavigateBack Start
>>>>> 04/27/2026 12:42:12 FixtureSetup for ShellOnBackButtonPressedReturnFalseShouldNavigateBack
>>>>> 04/27/2026 12:42:23 ShellOnBackButtonPressedReturnFalseShouldNavigateBack Stop
>>>>> 04/27/2026 12:42:23 Log types: logcat, bugreport, server
Failed ShellOnBackButtonPressedReturnFalseShouldNavigateBack [14 s]
Error Message:
Shell.OnBackButtonPressed should have been called even when returning false.
Assert.That(shellStatusText, Is.EqualTo("OnBackButtonPressed Called And Returned False"))
Expected string length 45 but was 7. Strings differ at index 0.
Expected: "OnBackButtonPressed Called And Returned False"
But was: "Waiting"
-----------^
Stack Trace:
at Microsoft.Maui.TestCases.Tests.Issues.Issue9095.ShellOnBackButtonPressedReturnFalseShouldNavigateBack() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9095.cs:line 75
1) at Microsoft.Maui.TestCases.Tests.Issues.Issue9095.ShellOnBackButtonPressedReturnFalseShouldNavigateBack() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9095.cs:line 75
>>>>> 04/27/2026 12:42:26 ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton Start
>>>>> 04/27/2026 12:42:26 FixtureSetup for ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton
>>>>> 04/27/2026 12:42:39 ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton Stop
>>>>> 04/27/2026 12:42:39 Log types: logcat, bugreport, server
Failed ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton [16 s]
Error Message:
Shell.OnBackButtonPressed should be invoked when pressing the Shell toolbar back button.
Assert.That(updatedText, Is.EqualTo("OnBackButtonPressed Called"))
Expected string length 26 but was 30. Strings differ at index 20.
Expected: "OnBackButtonPressed Called"
But was: "OnBackButtonPressed Not Called"
-------------------------------^
Stack Trace:
at Microsoft.Maui.TestCases.Tests.Issues.Issue9095.ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9095.cs:line 45
1) at Microsoft.Maui.TestCases.Tests.Issues.Issue9095.ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9095.cs:line 45
NUnit Adapter 4.5.0.0: Test execution complete
Total tests: 2
Test Run Failed.
Failed: 2
Total time: 52.4930 Seconds
🟢 With fix — 🖥️ Issue9095: PASS ✅ · 560s
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:07:07.22
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.70-ci+azdo.13944033
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.12] Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.42] Discovered: Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
NUnit3TestExecutor discovered 2 of 2 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 04/27/2026 12:52:10 ShellOnBackButtonPressedReturnFalseShouldNavigateBack Start
>>>>> 04/27/2026 12:52:10 FixtureSetup for ShellOnBackButtonPressedReturnFalseShouldNavigateBack
>>>>> 04/27/2026 12:52:19 ShellOnBackButtonPressedReturnFalseShouldNavigateBack Stop
Passed ShellOnBackButtonPressedReturnFalseShouldNavigateBack [10 s]
>>>>> 04/27/2026 12:52:21 ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton Start
>>>>> 04/27/2026 12:52:21 FixtureSetup for ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton
>>>>> 04/27/2026 12:52:32 ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton Stop
Passed ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton [12 s]
NUnit Adapter 4.5.0.0: Test execution complete
Test Run Successful.
Total tests: 2
Passed: 2
Total time: 35.2837 Seconds
⚠️ Issues found
⚠️ Issue9095 without fix:Exception calling "Matches" with "2" argument(s): "Value cannot be null. (Parameter 'input')"
📁 Fix files reverted (1 files)
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs
🧪 UI Tests — Category Detection
Detected UI test categories: Shell
🔍 Pre-Flight — Context & Validation
Issue: #9095 - On Screen Back Button Does Not Fire OnBackButtonPressed in Android
PR: #35150 - [Android] Fix OnBackButtonPressed not invoked for Shell
Platforms Affected: Android (iOS tracked separately in PR #35072)
Files Changed: 1 implementation, 2 test
Key Findings
ShellToolbarTracker.OnNavigateBack()(Android) was callingPage?.SendBackButtonPressed()directly, bypassingShell.OnBackButtonPressed()entirely for toolbar back-button taps- Fix changes the call to
_shell?.SendBackButtonPressed()so Shell subclass overrides are invoked first, matching hardware/system back button behavior OnClick()already handlesBackButtonBehavior.Commandbefore reachingOnNavigateBack(), so there is no regression for BackButtonBehavior users- Shell.OnBackButtonPressed() internally delegates to
GetVisiblePage().SendBackButtonPressed(), so the ContentPage handler is still called — just via Shell - iOS has the same root bug in
ShellSectionRenderer.cs(callsPage?.SendBackButtonPressed()directly) — not fixed here; tracked in PR [iOS, Mac] Fix OnBackButtonPressed not invoked for NavigationPage and Shell #35072 - Test
#ifguard uses||where&&is required — results in tests running on iOS/Catalyst where the iOS fix is still pending (❌ Error per code review)
Code Review Summary
Verdict: NEEDS_CHANGES
Confidence: high
Errors: 1 | Warnings: 1 | Suggestions: 1
Key code review findings:
- ❌
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9095.cs:1—#if TEST_FAILS_ON_IOS || TEST_FAILS_ON_CATALYSTshould be&&. With||the test compiles/runs on iOS and macCatalyst where the fix is not yet applied, causing CI failures. ⚠️ src/Controls/tests/TestCases.HostApp/Issues/Issue9095.cs:2-4—PlatformAffected.Androidonly, but the issue description string says "Android and iOS". Should be updated when iOS fix lands.- 💡
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9095.cs— First test could add an explicit assertion thatIssue9095SecondPageis still visible (navigation was blocked) rather than relying solely on label text.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #35150 | Route OnNavigateBack() through _shell?.SendBackButtonPressed() instead of Page?.SendBackButtonPressed() |
✅ PASSED (Gate) | ShellToolbarTracker.cs |
One-line fix |
🔬 Code Review — Deep Analysis
Code Review — PR #35150
Independent Assessment
What this changes: In ShellToolbarTracker.OnNavigateBack() (Android), the call site changes from Page?.SendBackButtonPressed() to _shell?.SendBackButtonPressed(). This routes the toolbar back-button tap through Shell.OnBackButtonPressed() instead of calling the page's back-button handler directly.
Two UI test files are added: a HostApp reproduction page (Issue9095.cs) and an NUnit test file (Issue9095.cs). The HostApp uses a TestShell subclass with a custom OnBackButtonPressed() override that sets a static flag, and a root page's OnAppearing() reads those flags to prove which handlers fired.
Inferred motivation: When a user taps the native toolbar back arrow in Shell navigation on Android, Shell.OnBackButtonPressed() (which Shell subclass authors typically override) was being skipped entirely—only the ContentPage.OnBackButtonPressed() was called. This broke a common shell customization pattern.
Is the approach sound? Yes. On Android, Shell.OnBackButtonPressed() already internally calls GetVisiblePage().SendBackButtonPressed(), so the page-level handler is still called—it's now called from within Shell.OnBackButtonPressed() rather than from ShellToolbarTracker directly. The existing OnClick handler already guards BackButtonBehavior.Command before reaching OnNavigateBack(), so there's no double-invocation risk.
Reconciliation with PR Narrative
Author claims: Android OnNavigateBack() bypassed Shell.OnBackButtonPressed() entirely; the fix routes through it to match hardware-back-button behavior. iOS is not changed by this PR; a separate PR (#35072) covers iOS.
Agreement: Full agreement on root cause and fix approach. The single-line change in ShellToolbarTracker.cs is correct and minimal.
One concern: The test file uses #if TEST_FAILS_ON_IOS || TEST_FAILS_ON_CATALYST as the compilation guard, but based on how those constants are defined in the platform test projects, || does not produce the intended exclusion. See Findings below.
Findings
❌ Error — || should be && in the test's #if guard
File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9095.cs, line 1
The test is guarded with:
#if TEST_FAILS_ON_IOS || TEST_FAILS_ON_CATALYST // PR link: https://github.com/dotnet/maui/pull/35072The constants are defined on the project that is NOT that platform:
| Test project | Defines |
|---|---|
TestCases.Android.Tests |
TEST_FAILS_ON_IOS, TEST_FAILS_ON_CATALYST, TEST_FAILS_ON_WINDOWS |
TestCases.iOS.Tests |
TEST_FAILS_ON_ANDROID, TEST_FAILS_ON_WINDOWS, TEST_FAILS_ON_CATALYST |
TestCases.Mac.Tests |
TEST_FAILS_ON_ANDROID, TEST_FAILS_ON_WINDOWS, TEST_FAILS_ON_IOS |
Evaluating TEST_FAILS_ON_IOS || TEST_FAILS_ON_CATALYST:
- Android: both defined →
true→ included ✓ - iOS: only
TEST_FAILS_ON_CATALYSTdefined →true→ included ✗ (iOS fix is pending in [iOS, Mac] Fix OnBackButtonPressed not invoked for NavigationPage and Shell #35072) - macCatalyst: only
TEST_FAILS_ON_IOSdefined →true→ included ✗ (same) - Windows: both defined →
true→ included (unverified behavior)
The result is that the test is compiled and runs on all platforms including iOS and macCatalyst. But the underlying ShellSectionRenderer.cs (iOS) still calls Page?.SendBackButtonPressed() directly (not fixed in this PR), so the test can fail on iOS/Mac, producing noisy CI failures.
The correct guard to exclude iOS and macCatalyst until #35072 merges is:
#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST // PR link: https://github.com/dotnet/maui/pull/35072With &&, iOS excludes itself (doesn't define TEST_FAILS_ON_IOS) and macCatalyst excludes itself (doesn't define TEST_FAILS_ON_CATALYST). Android defines both, so it's included.
⚠️ Warning — Issue9095.cs HostApp title says "Android and iOS" but PlatformAffected.Android only
File: src/Controls/tests/TestCases.HostApp/Issues/Issue9095.cs, line 2–4
[Issue(IssueTracker.Github, 9095,
"Shell toolbar back button doesn't fire Shell.OnBackButtonPressed on Android and iOS",
PlatformAffected.Android)]The description mentions "Android and iOS" but PlatformAffected is only Android. Once PR #35072 (iOS fix) lands, this should be updated to PlatformAffected.Android | PlatformAffected.iOS. Not a blocker, but worth updating when the iOS fix is merged.
💡 Suggestion — Consider asserting the back navigation actually occurred in ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton
File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9095.cs, ShellOnBackButtonPressedShouldBeInvokedWhenPressingNavigationBarBackButton test
The first test verifies that Shell.OnBackButtonPressed was called (via label text) and that the page is still visible (because Shell.OnBackButtonPressed returns true blocking navigation). However, it doesn't explicitly verify that the Issue9095SecondPage is still the current page—it only asserts the label text changed to "OnBackButtonPressed Called". Since this is the success/blocked-navigation scenario, it would be stronger to also verify the second page is still in view. This is minor since WaitForElement is already called, but an explicit "still on second page" assertion via unique element would be clearer.
Devil's Advocate
On the core fix: Could calling _shell?.SendBackButtonPressed() introduce double-navigation? No—when Shell.OnBackButtonPressed() pops the stack via its internal NavigationPop(), it returns true, causing OnNavigateBack to return early. Page.Navigation.PopAsync() is never called in that path. Both old and new paths result in exactly one pop.
On the || bug: Am I sure? Yes. The DefineConstants in all three platform test .csproj files confirm the convention. The || logic is unambiguously wrong for the intended iOS/Catalyst exclusion.
On navigation when stack count ≤ 1: If CanNavigateBack is set via _canNavigateBack = true while the stack has only one item, Shell.OnBackButtonPressed() will fire the navigation-cancelled event path and likely return false, falling through to Page.Navigation.PopAsync(). This is the same outcome as the old code. No regression.
Verdict: NEEDS_CHANGES
Confidence: High
Summary: The one-line fix in ShellToolbarTracker.cs is correct, minimal, and well-reasoned. The || → && bug in the test's #if guard is a concrete defect: it compiles and runs the test on iOS and macCatalyst where the iOS fix is explicitly listed as pending (#35072), which will cause test failures on those platforms. This needs to be fixed before merge.
🔧 Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix | Route through Shell at OnClick dispatch level — call _shell?.SendBackButtonPressed() in OnClick before OnNavigateBack(); also fix ` |
→&&` in test guard |
✅ PASS | |
| 2 | try-fix | Route through IWindow.BackButtonClicked() in OnNavigateBack — mirrors hardware back button path, matches ToolbarHandler.Android.cs; also fix test guard |
✅ PASS | 2 files | Cleaner abstraction but adds Window indirection |
| 3 | try-fix | Use OnBackPressedDispatcher.OnBackPressed() in OnNavigateBack |
❌ FAIL | 1 file | Sends app to launcher — wrong level |
| 4 | try-fix (gemini) | N/A — model unavailable | — | gemini-3-pro-preview not available | |
| PR | PR #35150 | Change Page?.SendBackButtonPressed() to _shell?.SendBackButtonPressed() in OnNavigateBack() |
✅ PASSED (Gate) | 1 file (+ 2 test) | Minimal one-line fix; test #if guard needs && fix |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| claude-opus-4.6 | 2 | Yes | Fix in Page.cs to walk parent chain to Shell — riskier, global change |
| claude-sonnet-4.6 | 2 | No | Solution space exhausted |
| gpt-5.3-codex | 2 | Yes | Use GoToAsync("..") as fallback instead of PopAsync — minor refinement, not a fundamentally different fix |
Exhausted: Yes (3 of 4 model attempts completed; gemini unavailable; cross-pollination new ideas evaluated and not pursued)
Selected Fix: PR's fix — most minimal (single-line change in OnNavigateBack), directly addresses root cause with no behavioral regressions. Gate passed. The || → && test guard fix must also be applied before merge.
📋 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Phase Status
| Phase | Status | Notes |
|---|---|---|
| Pre-Flight | ✅ COMPLETE | Issue #9095, Android Shell toolbar back button bypassing Shell.OnBackButtonPressed |
| Code Review | NEEDS_CHANGES (high) | 1 error, 1 warning, 1 suggestion |
| Gate | ✅ PASSED | android (with-fix: PASS; without-fix: ENV ERROR — environment issue on baseline run, not a fix regression) |
| Try-Fix | ✅ COMPLETE | 3 of 4 attempts (gemini unavailable); 2 passing alternatives found |
| Report | ✅ COMPLETE |
Code Review Impact on Try-Fix
The code review ❌ Error (test #if guard using || instead of &&) was surfaced as a hint to all try-fix models. Attempts 1 and 2 both independently fixed the guard (|| → &&) alongside their core fix, confirming the defect. No model found the || guard acceptable. Failure-mode probing on double-pop was validated: all passing approaches avoid double pop because Shell.OnBackButtonPressed returns true after NavigationPop(), causing OnNavigateBack to exit early.
Summary
The core fix in ShellToolbarTracker.cs is correct and minimal — changing Page?.SendBackButtonPressed() to _shell?.SendBackButtonPressed() in OnNavigateBack() ensures Shell subclass overrides are invoked for toolbar back-button taps, matching hardware back button behavior. However, the test guard in Issue9095.cs uses || where && is required, causing the test to compile and execute on iOS and macCatalyst where the iOS fix is still pending (PR #35072). This will produce CI failures on those platforms.
Root Cause
ShellToolbarTracker.OnNavigateBack() called Page?.SendBackButtonPressed() directly on the ContentPage, bypassing Shell.OnBackButtonPressed() entirely for the toolbar back button. The hardware/system back button routes through Shell (via Window.BackButtonClicked → Shell.SendBackButtonPressed), but the toolbar back button took a shortcut to the page. This meant Shell subclass overrides of OnBackButtonPressed were silently ignored.
Fix Quality
The PR's one-line fix in ShellToolbarTracker.cs is sound: _shell?.SendBackButtonPressed() routes through Shell first, which internally delegates to GetVisiblePage().SendBackButtonPressed() — so ContentPage.OnBackButtonPressed is still called (via Shell), and Shell subclass overrides are now correctly invoked. BackButtonBehavior.Command is unaffected (handled in OnClick() before OnNavigateBack() is reached). No double-pop risk.
Required change before merge: Fix the #if guard in src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9095.cs line 1:
// Before (incorrect):
#if TEST_FAILS_ON_IOS || TEST_FAILS_ON_CATALYST
// After (correct):
#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYSTAgents didn't know what to do when no CI builds existed (common for community PRs) or when devicetests/uitests weren't triggered. Added note about /azp run commands and explicit pipeline triggers. Discovered via multi-agent testing against PRs #35144 and #35150. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
kubaflo
left a comment
There was a problem hiding this comment.
Can you enable the test only on android with annotation to PR that has the iOSs fix?
Enabled the test only on Android and added an annotation referencing the iOS/Mac fix PR. |
There was a problem hiding this comment.
Pull request overview
Fixes Android Shell toolbar “up” navigation so it goes through Shell.OnBackButtonPressed (matching system/hardware back behavior) and adds a new Issue9095 HostApp page + UI test coverage.
Changes:
- Android: route toolbar back navigation through
Shell.SendBackButtonPressed()before popping. - Tests: add HostApp reproduction page for #9095.
- Tests: add Android UI tests validating Shell + ContentPage back interception.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs | Ensures toolbar back uses Shell’s back-press pipeline before navigating. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue9095.cs | Adds a Shell-based repro page and state markers for back-press behavior. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9095.cs | Adds UI tests (currently Android-only) to verify back-button behavior. |
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 9095, | ||
| "Shell toolbar back button doesn't fire Shell.OnBackButtonPressed on Android and iOS", |
| internal static bool BackButtonPressedCalledReturnFalse; | ||
| internal static bool ContentPageBackButtonPressedCalledReturnFalse; |
| if (BackButtonPressedCalledReturnFalse) | ||
| { | ||
| _returnFalseStatusLabel.Text = "OnBackButtonPressed Called And Returned False"; | ||
| BackButtonPressedCalledReturnFalse = false; | ||
| } | ||
| if (ContentPageBackButtonPressedCalledReturnFalse) | ||
| { | ||
| _contentPageReturnFalseStatusLabel.Text = "ContentPage OnBackButtonPressed Called And Returned False"; | ||
| ContentPageBackButtonPressedCalledReturnFalse = false; |
| // Tap the Shell toolbar back button | ||
| if (App is AppiumIOSApp iosApp && HelperExtensions.IsIOS26OrHigher(iosApp)) | ||
| App.TapBackArrow(); // iOS 26+ doesn't show the previous page title in the back button | ||
| else | ||
| App.TapBackArrow(Device is TestDevice.iOS or TestDevice.Mac ? "HomePage" : ""); | ||
|
|
| [Test] | ||
| [Category(UITestCategories.Shell)] | ||
| public void ShellOnBackButtonPressedReturnFalseShouldNavigateBack() | ||
| { |
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details: Shell.OnBackButtonPressed not invoked when the toolbar back button is tapped on Android and iOS Shell pages ### Root Cause - Android (ShellToolbarTracker.cs): OnNavigateBack() called Page?.SendBackButtonPressed() directly on the ContentPage, bypassing Shell.OnBackButtonPressed and any Shell-level interception entirely. ### Description of change **ShellToolbarTracker.cs** (Android Shell) - In OnNavigateBack(), route through _shell?.SendBackButtonPressed() instead of Page?.SendBackButtonPressed(). This ensures Shell.OnBackButtonPressed is called first, matching the behavior of the hardware/system back button. ### Test results #### Shell — `OnBackButtonPressed` (fixes #9095) | Platform | Navigation | `OnBackButtonPressed` | |---|---|---| | iOS / MacCatalyst | `GoToAsync` | ✅ Triggered | | Android | `GoToAsync` | ✅ Triggered (app back button and emulator back button) | | Windows | `GoToAsync` | ✅ Triggered | >`OnBackButtonPressed` is triggered for both the `Shell` and the contained `ContentPage`. #### TabbedPage — `OnBackButtonPressed` | Platform | Navigation | `OnBackButtonPressed` | Notes | |---|---|---|---| | iOS / MacCatalyst | `PushAsync` | ✅ Triggered | | | iOS / MacCatalyst | `PushModalAsync` | — | Back button not visible in modal navigation | | Android | `PushAsync` | ✅ Triggered | | | Android | `PushModalAsync` | ✅ Triggered | | | Windows | `PushAsync` | ✅ Triggered | | | Windows | `PushModalAsync` | — | Back button not visible in modal navigation | #### FlyoutPage — `OnBackButtonPressed` | Platform | Navigation | `OnBackButtonPressed` | Notes | |---|---|---|---| | iOS / MacCatalyst | `PushAsync` | ✅ Triggered | | | iOS / MacCatalyst | `PushModalAsync` | — | Back button not visible in modal navigation | | Android | `PushAsync` | ✅ Triggered | | | Android | `PushModalAsync` | ✅ Triggered | | | Windows | `PushAsync` | ✅ Triggered | | | Windows | `PushModalAsync` | — | Back button not visible in modal navigation | ### Validated the behaviour in the following platforms - [x] Android - [ ] Windows - [ ] iOS - [ ] Mac ### Issue Fixes Fixes #9095 ### Screenshots | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/9d2257ff-be1d-4ede-95c2-47d5fae64c33"> | <video src="https://github.com/user-attachments/assets/dc7f54a1-dcdf-4239-b95e-72c6c73b858c"> |
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details: Shell.OnBackButtonPressed not invoked when the toolbar back button is tapped on Android and iOS Shell pages ### Root Cause - Android (ShellToolbarTracker.cs): OnNavigateBack() called Page?.SendBackButtonPressed() directly on the ContentPage, bypassing Shell.OnBackButtonPressed and any Shell-level interception entirely. ### Description of change **ShellToolbarTracker.cs** (Android Shell) - In OnNavigateBack(), route through _shell?.SendBackButtonPressed() instead of Page?.SendBackButtonPressed(). This ensures Shell.OnBackButtonPressed is called first, matching the behavior of the hardware/system back button. ### Test results #### Shell — `OnBackButtonPressed` (fixes #9095) | Platform | Navigation | `OnBackButtonPressed` | |---|---|---| | iOS / MacCatalyst | `GoToAsync` | ✅ Triggered | | Android | `GoToAsync` | ✅ Triggered (app back button and emulator back button) | | Windows | `GoToAsync` | ✅ Triggered | >`OnBackButtonPressed` is triggered for both the `Shell` and the contained `ContentPage`. #### TabbedPage — `OnBackButtonPressed` | Platform | Navigation | `OnBackButtonPressed` | Notes | |---|---|---|---| | iOS / MacCatalyst | `PushAsync` | ✅ Triggered | | | iOS / MacCatalyst | `PushModalAsync` | — | Back button not visible in modal navigation | | Android | `PushAsync` | ✅ Triggered | | | Android | `PushModalAsync` | ✅ Triggered | | | Windows | `PushAsync` | ✅ Triggered | | | Windows | `PushModalAsync` | — | Back button not visible in modal navigation | #### FlyoutPage — `OnBackButtonPressed` | Platform | Navigation | `OnBackButtonPressed` | Notes | |---|---|---|---| | iOS / MacCatalyst | `PushAsync` | ✅ Triggered | | | iOS / MacCatalyst | `PushModalAsync` | — | Back button not visible in modal navigation | | Android | `PushAsync` | ✅ Triggered | | | Android | `PushModalAsync` | ✅ Triggered | | | Windows | `PushAsync` | ✅ Triggered | | | Windows | `PushModalAsync` | — | Back button not visible in modal navigation | ### Validated the behaviour in the following platforms - [x] Android - [ ] Windows - [ ] iOS - [ ] Mac ### Issue Fixes Fixes #9095 ### Screenshots | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/9d2257ff-be1d-4ede-95c2-47d5fae64c33"> | <video src="https://github.com/user-attachments/assets/dc7f54a1-dcdf-4239-b95e-72c6c73b858c"> |
|
/backport to release/10.0.1xx-sr7 |
|
Started backporting to |
…for Shell (#35430) Backport of #35150 to release/10.0.1xx-sr7 /cc @kubaflo @Dhivya-SF4094 --------- Co-authored-by: Dhivya-SF4094 <127717131+Dhivya-SF4094@users.noreply.github.com>
… for NavigationPage and Shell (#35434) > [!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! Manual backport of #35072 to `release/10.0.1xx-sr7`. ## Why this is a manual backport The automated `/backport` workflow ([failed run](https://github.com/dotnet/maui/actions/runs/25818135030)) hit a `modify/delete` conflict on `src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9095.cs`. The file is added by #35150 (already backported as #35430, currently OPEN) and modified by #35072. Because #35430 is not yet merged into `release/10.0.1xx-sr7`, the file does not exist on the target branch and the patch could not apply cleanly. ## Resolution Cherry-picked the squashed merge commit `7023635baac2524ab02f602e56fd7608142984a1` of #35072 onto `release/10.0.1xx-sr7`. Resolved the conflict by keeping the post-merge version of `Issue9095.cs` (verified byte-identical to `inflight/current`, which contains both #35150's added content and #35072's tweaks). ##⚠️ Dependency on #35430 This PR's diff currently shows `Issue9095.cs` as a new file because it includes content originally introduced by #35150. Recommended merge order: 1. Merge #35430 (Android backport of #35150) first. 2. This PR will then auto-rebase to show only #35072's incremental delta (a 2-line change to `Issue9095.cs` and the `ShellSectionRenderer.cs` / `NavigationRenderer.cs` / `Issue8296.cs` changes). Alternatively, this PR can be merged first, but #35430 will then need a manual conflict resolution (the file would already exist). Fixes #8296 in `release/10.0.1xx-sr7`. --------- Co-authored-by: Dhivya-SF4094 <127717131+Dhivya-SF4094@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details: Shell.OnBackButtonPressed not invoked when the toolbar back button is tapped on Android and iOS Shell pages ### Root Cause - Android (ShellToolbarTracker.cs): OnNavigateBack() called Page?.SendBackButtonPressed() directly on the ContentPage, bypassing Shell.OnBackButtonPressed and any Shell-level interception entirely. ### Description of change **ShellToolbarTracker.cs** (Android Shell) - In OnNavigateBack(), route through _shell?.SendBackButtonPressed() instead of Page?.SendBackButtonPressed(). This ensures Shell.OnBackButtonPressed is called first, matching the behavior of the hardware/system back button. ### Test results #### Shell — `OnBackButtonPressed` (fixes #9095) | Platform | Navigation | `OnBackButtonPressed` | |---|---|---| | iOS / MacCatalyst | `GoToAsync` | ✅ Triggered | | Android | `GoToAsync` | ✅ Triggered (app back button and emulator back button) | | Windows | `GoToAsync` | ✅ Triggered | >`OnBackButtonPressed` is triggered for both the `Shell` and the contained `ContentPage`. #### TabbedPage — `OnBackButtonPressed` | Platform | Navigation | `OnBackButtonPressed` | Notes | |---|---|---|---| | iOS / MacCatalyst | `PushAsync` | ✅ Triggered | | | iOS / MacCatalyst | `PushModalAsync` | — | Back button not visible in modal navigation | | Android | `PushAsync` | ✅ Triggered | | | Android | `PushModalAsync` | ✅ Triggered | | | Windows | `PushAsync` | ✅ Triggered | | | Windows | `PushModalAsync` | — | Back button not visible in modal navigation | #### FlyoutPage — `OnBackButtonPressed` | Platform | Navigation | `OnBackButtonPressed` | Notes | |---|---|---|---| | iOS / MacCatalyst | `PushAsync` | ✅ Triggered | | | iOS / MacCatalyst | `PushModalAsync` | — | Back button not visible in modal navigation | | Android | `PushAsync` | ✅ Triggered | | | Android | `PushModalAsync` | ✅ Triggered | | | Windows | `PushAsync` | ✅ Triggered | | | Windows | `PushModalAsync` | — | Back button not visible in modal navigation | ### Validated the behaviour in the following platforms - [x] Android - [ ] Windows - [ ] iOS - [ ] Mac ### Issue Fixes Fixes #9095 ### Screenshots | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/9d2257ff-be1d-4ede-95c2-47d5fae64c33"> | <video src="https://github.com/user-attachments/assets/dc7f54a1-dcdf-4239-b95e-72c6c73b858c"> |
## What's Coming .NET MAUI inflight/candidate introduces significant improvements across all platforms with focus on quality, performance, and developer experience. This release includes 85 commits with various improvements, bug fixes, and enhancements. ## Button - [Android, iOS] Button: Fix VisualState properties not restored when leaving custom state by @BagavathiPerumal in #33346 <details> <summary>🔧 Fixes</summary> - [Button VisualStates do not work](#19690) </details> ## CollectionView - Fix CollectionView grid spacing updates for first row and column by @KarthikRajaKalaimani in #34527 <details> <summary>🔧 Fixes</summary> - [[MAUI] I2_Vertical grid for horizontal Item Spacing and Vertical Item Spacing - horizontally updating the spacing only applies to the second column](#34257) </details> - CarouselView: Fix cascading PositionChanged/CurrentItemChanged events on collection update by @praveenkumarkarunanithi in #31275 <details> <summary>🔧 Fixes</summary> - [[Windows] CurrentItemChangedEventArgs and PositionChangedEventArgs Not Working Properly in CarouselView](#29529) </details> - [Windows] Fixed ItemSpacing doesn't work in Carousel View by @SubhikshaSf4851 in #30014 <details> <summary>🔧 Fixes</summary> - [ItemSpacing on CarouselView is not applied on Windows.](#29772) </details> - Fix CollectionView not scrolling to top on iOS status bar tap by @jfversluis in #34687 <details> <summary>🔧 Fixes</summary> - [[iOS] UICollectionView ScrollToTop does not work](#19866) </details> - [iOS] Fixed CollectionView Scroll Jitter for TextType HTML Labels by @SubhikshaSf4851 in #34383 <details> <summary>🔧 Fixes</summary> - [CollectionView scrolling is jittery when ItemTemplate contains Label with TextType="Html" in .NET 10](#33065) </details> - Fix CollectionView Header is not visible when ItemsSource is not set and an EmptyView is set in iOS, Mac platform by @KarthikRajaKalaimani in #34989 <details> <summary>🔧 Fixes</summary> - [CollectionView Header is not visible when ItemsSource is not set and EmptyView is set in iOS, Mac platform](#34897) </details> - [Android] Fix CollectionView EmptyView not displayed correctly by @KarthikRajaKalaimani in #34956 <details> <summary>🔧 Fixes</summary> - [[Android] CollectionView - EmptyView not displayed correctly](#34861) </details> - [iOS] Fix CollectionView ScrollOffset not resetting when ItemsSource changes by @SyedAbdulAzeemSF4852 in #34488 <details> <summary>🔧 Fixes</summary> - [[IOS] CollectionView ScrollOffset does not reset when the ItemSource is changed in iOS.](#26366) - [Re-enable Issue7993 test on iOS/Catalyst - CollectionView scroll position not reset when updating ItemsSource](#33500) </details> - [Revert] [iOS] Fixed CollectionView Scroll Jitter for TextType HTML Labels by @SubhikshaSf4851 in #35341 ## Core Lifecycle - [Android] Fix NRE in ContainerView when Android Context is null during lifecycle transition by @rmarinho in #34901 <details> <summary>🔧 Fixes</summary> - [[Android] NullReferenceException in NavigationRootManager.Connect when mapping Window content](#34900) </details> ## DateTimePicker - [Android] Fix for TimePicker Dialog doesn't update the layout when rotating the device with dialog open by @HarishwaranVijayakumar in #31910 <details> <summary>🔧 Fixes</summary> - [[Android] TimePicker Dialog doesn't update the layout when rotating the device with dialog open](#31658) </details> - [Android, iOS] Fixed TimePicker FlowDirection Not Applied Across Platforms by @Dhivya-SF4094 in #30369 <details> <summary>🔧 Fixes</summary> - [TimePicker FlowDirection Not Working on All Platforms](#30192) </details> - [Windows] Fixed TimePicker CharacterSpacing issue by @SubhikshaSf4851 in #30533 <details> <summary>🔧 Fixes</summary> - [[Windows] TimePicker CharacterSpacing Property Not Working on Windows](#30199) </details> - [MacCatalyst] Fix DatePicker Opened/Closed events not being raised by @SubhikshaSf4851 in #34970 <details> <summary>🔧 Fixes</summary> - [[MacCatalyst] DatePicker Opened and Closed events are not raised on Mac platform](#34848) </details> ## Dialogalert - [Android] Fix AlertDialog, ActionSheet, and Prompt render with Material 2 styles when Material 3 is enabled by @HarishwaranVijayakumar in #35121 <details> <summary>🔧 Fixes</summary> - [[Android] AlertDialog, ActionSheet, and Prompt render with Material 2 styles when Material 3 is enabled](#35119) </details> ## Docs - docs: Add UITesting-Guide, ReleasePlanning, and ReleaseProcess to docs/README.md index by @PureWeen in #35195 - docs: Fix hardcoded path and add library overview in Essentials.AI README by @PureWeen in #35194 - docs: Update branch reference from net10.0 to net11.0 in DEVELOPMENT.md by @PureWeen in #35193 ## Drawing - Fix Path Rendering Issue Inside StackLayout When Margin Is Set by @Shalini-Ashokan in #28071 <details> <summary>🔧 Fixes</summary> - [Path does not render if it has Margin](#13801) </details> - Fixed FlowDirection property not working on Drawable control and GraphicsView by @Dhivya-SF4094 in #34557 <details> <summary>🔧 Fixes</summary> - [[Android, Windows, iOS, macOS] FlowDirection property not working on BoxView Control](#34402) </details> - [iOS & Mac] Fix image tile misalignment in GraphicsView ImagePaint by @SubhikshaSf4851 in #34935 <details> <summary>🔧 Fixes</summary> - [[iOS] Image resized with ResizeMode.Fit is not rendered correctly in GraphicsView](#34755) </details> - Fix Shadow does not honour Styles by @KarthikRajaKalaimani in #35081 <details> <summary>🔧 Fixes</summary> - [Shadow does not honour Styles](#19560) </details> ## Entry - [iOS/macCatalyst] Fix Entry and Editor BackgroundColor reset when set to null by @Shalini-Ashokan in #34741 <details> <summary>🔧 Fixes</summary> - [[iOS, Maccatalyst] Entry & Editor BackgroundColor not reset to Null](#34611) </details> - [Windows] Fix password Entry crash when setting text on empty field by @praveenkumarkarunanithi in #33891 <details> <summary>🔧 Fixes</summary> - [[WinUI] Password Obfuscation causes unhandled crash](#33334) </details> ## Essentials - [Essentials] Use mean sea level altitude on Android API 34+ by @KitKeen in #35097 <details> <summary>🔧 Fixes</summary> - [Add support for MslAltitudeMeters in Essentials Geolocation on Android](#27554) </details> ## Flyout - Fixed Flyout Not Displayed on Android When FlyoutWidth Is Set Only for Desktop via OnIdiom by @NanthiniMahalingam in #29028 <details> <summary>🔧 Fixes</summary> - [[Android] FlyoutWidth with OnIdiom shows no flyout](#13243) </details> - Revert "[Windows] Fix Flyout/Locked mode header collapse regression causing UI test failures on candidate branch" by @kubaflo in #35339 - Revert "Revert "[Windows] Fix Flyout/Locked mode header collapse regression causing UI test failures on candidate branch"" by @kubaflo in #35342 ## Flyoutpage - Fix [Android] Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage by @KarthikRajaKalaimani in #34839 <details> <summary>🔧 Fixes</summary> - [[Android] Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage](#33615) </details> ## Label - [iOS] Fix span Tap gesture on wrapped Label lines in iOS 26+ by @SubhikshaSf4851 in #34640 <details> <summary>🔧 Fixes</summary> - [[iOS]Span TapGestureRecognizer does not work on the second line of the span, if the span is wrapped to the next line](#34504) </details> ## Layout - Fixed Stacklayout is not rendered when clip is applied and StackLayout placed child to the Border control in iOS/ Mac platform by @KarthikRajaKalaimani in #33330 <details> <summary>🔧 Fixes</summary> - [[Mac/iOS] StackLayout fails to render content while applying Clip, and the layout is placed inside a Border with Background in .NET MAUI](#33241) </details> ## Map - Fix Changing Location on a Pin does nothing by @NirmalKumarYuvaraj in #30201 <details> <summary>🔧 Fixes</summary> - [[Maps] [Regression from Xamarin.Forms.Maps] Changing Location on a Pin does nothing](#12916) </details> ## Mediapicker - [iOS] Fix HEIC images picked via PickPhotosAsync not displayed by @HarishwaranVijayakumar in #34954 <details> <summary>🔧 Fixes</summary> - [[iOS] [Regression] HEIC images picked via PickPhotosAsync not displayed](#34953) </details> - [Android] Fix MediaPicker.PickPhotosAsync UnauthorizedAccessException on API 28 and below by @HarishwaranVijayakumar in #34981 <details> <summary>🔧 Fixes</summary> - [MediaPicker.PickPhotos fails to modify image, tries to load original source, fails to load source on Android 9.0](#34889) </details> ## Pages - [iOS] Fix ContentPage with ToolbarItem Clicked event leaks when presented as modal page by @devanathan-vaithiyanathan in #35009 <details> <summary>🔧 Fixes</summary> - [ContentPage with ToolbarItem Clicked event leaks when presented as modal page](#34892) </details> ## Platform - [Android] Fix OnBackButtonPressed not invoked for Shell by @Dhivya-SF4094 in #35150 <details> <summary>🔧 Fixes</summary> - [On Screen Back Button Does Not Fire OnBackButtonPressed in Android](#9095) </details> ## RadioButton - Fix RadioButtonGroup not working with ContentView by @Dhivya-SF4094 in #34781 <details> <summary>🔧 Fixes</summary> - [RadioButtonGroup not working with ContentView](#34759) </details> - [Windows] Fix for RadioButton BorderColor and BorderWidth not updated at runtime by @SyedAbdulAzeemSF4852 in #28335 <details> <summary>🔧 Fixes</summary> - [RadioButton Border color not working for focused visual state](#15806) </details> - [iOS] Fix RadioButton BackgroundColor bleeding outside CornerRadius by @SyedAbdulAzeemSF4852 in #34844 <details> <summary>🔧 Fixes</summary> - [[iOS] RadioButton BackgroundColor bleeds outside CornerRadius](#34842) </details> ## SafeArea - [iOS] Fix stale bottom safe area after changing SafeAreaEdges with keyboard open by @praveenkumarkarunanithi in #35083 <details> <summary>🔧 Fixes</summary> - [[iOS] ContentPage bottom has white space after changing SafeAreaEdges while keyboard is open](#34846) </details> ## ScrollView - [Windows] Fix Preserve ScrollView offsets when Orientation changes to Neither by @SubhikshaSf4851 in #34827 <details> <summary>🔧 Fixes</summary> - [[Windows] ScrollView offsets do not preserve when Orientation changes to Neither](#34671) </details> ## Searchbar - [iOS] Fix SearchBar unexpected left margin in iPad windowed mode on 26 Version by @SubhikshaSf4851 in #34704 <details> <summary>🔧 Fixes</summary> - [in iPad windowed mode SearchBar adds left margin equivaltent to SafeAreaInsets when placed inside grid](#34551) </details> ## Shell - [Windows] Fix for Shell.FlyoutBehavior="Flyout" forces the title height space above the tab bar even if the page title is empty by @BagavathiPerumal in #30382 <details> <summary>🔧 Fixes</summary> - [(Windows) Shell.FlyoutBehavior="Flyout" forces the title height space above the tab bar even if the page title is empty](#30254) </details> - Fix Shell flyout items scrolling behind FlyoutHeader on iOS by @Qythyx in #34936 <details> <summary>🔧 Fixes</summary> - [Shell flyout items scroll behind FlyoutHeader on iOS](#34925) </details> - [iOS, Mac] Fix Shell.CurrentState.Location stale in OnNavigated after GoToAsync by @Vignesh-SF3580 in #34880 <details> <summary>🔧 Fixes</summary> - [Shell.OnNavigated not called for route navigation](#34662) </details> - [iOS26]Fix BackButtonBehavior_IsEnabled_False_BackButtonDoesNotNavigate UITest fails by @devanathan-vaithiyanathan in #34890 <details> <summary>🔧 Fixes</summary> - [[iOS 26] BackButtonBehavior_IsEnabled_False_BackButtonDoesNotNavigate test fails with TimeoutException](#34771) </details> - [iOS] Fix Shell page memory leak when using TitleView with x:Name by @Shalini-Ashokan in #35082 <details> <summary>🔧 Fixes</summary> - [[iOS] Title view memory leak](#34975) </details> - [Material 3] Fix Material 2 color flash in AppBar when switching tabs for the first time by @Dhivya-SF4094 in #35117 <details> <summary>🔧 Fixes</summary> - [Material 3: AppBar briefly displays Material 2 colors when switching tabs for the first time](#35116) </details> - [Android] Fix Shell/TabbedPage "More" BottomSheet uses hard-coded M2 colors when Material3 is enabled by @HarishwaranVijayakumar in #35129 <details> <summary>🔧 Fixes</summary> - [[Android] Shell/TabbedPage "More" BottomSheet uses hard-coded M2 colors when Material3 is enabled](#35127) </details> - [Android] Shell: Fix top-tab unselected text visibility in Material 3 light theme by @SyedAbdulAzeemSF4852 in #35128 <details> <summary>🔧 Fixes</summary> - [[Android] Shell top-tab unselected text appears too faint in Material 3 light theme](#35125) </details> - Fix Shell.Items.Clear() memory leak by disconnecting child handlers on removal (#34898) by @Shalini-Ashokan in #35031 <details> <summary>🔧 Fixes</summary> - [Shell.Items.Clear() does not disconnect handlers correctly](#34898) </details> - [iOS&Mac] Fix Shell SearchHandler Query update on Initial load by @SubhikshaSf4851 in #35008 <details> <summary>🔧 Fixes</summary> - [[iOS&Mac] Shell SearchHandler Query not shown in search bar on initial load](#35005) </details> ## SwipeView - [iOS,MacCatalyst] Fix for SwipeView.Open() throwing an ArgumentException on the second programmatic call by @BagavathiPerumal in #34982 <details> <summary>🔧 Fixes</summary> - [[net 11.0][iOS,MacCatalyst] SwipeView.Open() throws ArgumentException on second programmatic call](#34917) </details> - [Android/iOS] Fix SwipeItem visibility change causing double command execution in Execute mode by @praveenkumarkarunanithi in #35087 <details> <summary>🔧 Fixes</summary> - [Changing visibility on an SwipeItem causes multiple items to be executed](#7580) </details> ## Switch - [iOS] Fix Switch ThumbColor reset on iOS 26+ theme changes. by @Shalini-Ashokan in #33953 <details> <summary>🔧 Fixes</summary> - [Switch ThumbColor not Initialized Using VisualStateManager on iOS Device](#33783) - [I9-On macOS 26.2, the "Animate scroll" button is white by default on iOS and Maccatalyst platforms.](#33767) </details> ## TabbedPage - [Windows] TabbedPage: Refresh layout when NavigationView size changes by @BagavathiPerumal in #26217 <details> <summary>🔧 Fixes</summary> - [TabbedPage - ScrollView not allowing scrolling when it should](#26103) - [TabbedPage App on resize hides page bottom content](#11402) - [Grid overflows child ContentPage of parent TabbedPage on initial load and when resizing on Windows](#20028) </details> - [Android] Material 3 Fixed BottomNavigationView overflowing in Tabbed page by @NirmalKumarYuvaraj in #35064 <details> <summary>🔧 Fixes</summary> - [[Android] Material3 - TabbedPage bottom tabs overflowing the contents](#35063) </details> - [Windows] Fix for Multiple Tabs Being Selected in WinUI TabbedPage by @SyedAbdulAzeemSF4852 in #33312 <details> <summary>🔧 Fixes</summary> - [WinUI TabbedPage can have multiple tabs selected](#31799) </details> ## Theming - [iOS] Fix StaticResource Hot Reload crash on iOS by @StephaneDelcroix in #35020 <details> <summary>🔧 Fixes</summary> - [The maui app quit and no errors in error list after editing ResourceDictionary XAML file on iOS Simulator with MAUI SR6 10.0.60](#35018) </details> ## Toolbar - [Windows] Fix for CS1061 build error caused by missing HasMenuBarContent property in MauiToolbar by @BagavathiPerumal in #35040 ## Tooling - Fix VisualStateGroups duplicate name crash with implicit styles (#34716) by @StephaneDelcroix in #34719 <details> <summary>🔧 Fixes</summary> - [SourceGen: VisualStateManager.VisualStateGroups causes 'Names must be unique' at startup](#34716) </details> ## WebView - Refactor the HybridWebView and properly support complex parameters by @mattleibow in #32491 - [Android] Fix WebView scrolling inside ScrollView by @Shalini-Ashokan in #33133 <details> <summary>🔧 Fixes</summary> - [[Android] WebView's content does not scroll when placed inside a ScrollView](#32971) </details> <details> <summary>🔧 Infrastructure (1)</summary> - [Windows] Fix Narrator announcing ContentView children twice when Description is set by @praveenkumarkarunanithi in #33979 <details> <summary>🔧 Fixes</summary> - [[Windows] SemanticProperties.Description announced twice when set on focusable container cell (Label inside)](#33373) </details> </details> <details> <summary>🧪 Testing (14)</summary> - [Testing] SafeArea Feature Matrix Test Cases for ContentPage by @TamilarasanSF4853 in #34877 - [Windows] Fix CollectionView ScrollTo related test cases failed in CI by @HarishwaranVijayakumar in #34907 <details> <summary>🔧 Fixes</summary> - [[Testing][Windows]CollectionView ScrollTo related test cases failed in CI](#34772) </details> - [Testing] Fixed Build error on inflight/ candidate PR 35234 by @HarishKumarSF4517 in #35241 - Fix CI for ValidateKeyboardRuntime_SwitchContainerToSoftInput_WhileKeyboardOpen test failure in May 4th Candidate by @devanathan-vaithiyanathan in #35307 - [Windows] Fix Flyout/Locked mode header collapse regression causing UI test failures on candidate branch by @BagavathiPerumal in #35312 - [iOS/macCatalyst] [Candidate Fix] Editor shadow and theme regression caused by BackgroundColor reset on initial handler connection by @Shalini-Ashokan in #35343 - [Testing] Fixed UI test image failure in PR 35234 - [30/03/2026] Candidate - 1 by @HarishKumarSF4517 in #35325 - [iOS] Fix ShellFeatureMatrix test failures on candidate branch by @Vignesh-SF3580 in #35346 - [Windows] Fix Issue29529VerifyPreviousPositionOnInsert test failure on candidate branch by @praveenkumarkarunanithi in #35398 - [Android] [Candidate Fix] Shell: Fix handler disconnect timing to preserve WebView navigation and memory leak fix by @Shalini-Ashokan in #35417 - [Testing]Revert 'Fix Preserve ScrollView offsets when Orientation changes to Neither' by @TamilarasanSF4853 in #35412 - [Windows] Fix VerifyAllIndicatorDotsShowShadowsWhenIndicatorSize test failure on candidate branch by @praveenkumarkarunanithi in #35458 - [Testing] Fixed test failure in PR 35234 - [05/08/2026] Candidate by @TamilarasanSF4853 in #35362 - [Testing] Fixed test failure in PR 35234 - [05/04/2026] Candidate - 3 by @TamilarasanSF4853 in #35639 </details> <details> <summary>📦 Other (6)</summary> - [UIKit] Avoid useless measure invalidation propagation cycles by @albyrock87 in #33459 - BindableObject property access micro-optimizations by @albyrock87 in #33584 - Extract filename from DisplayName and add extension if missing by @mattleibow in #35050 - [core] Add keyed-DI screenshot extensibility for 3rd-party platform backends by @Redth in #35096 <details> <summary>🔧 Fixes</summary> - [`ViewExtensions.CaptureAsync(IView)` and `IPlatformScreenshot` need extensibility for third-party platform backends](#34266) </details> - Fix MainThread throwing on custom platform backends by @Redth in #35070 <details> <summary>🔧 Fixes</summary> - [`MainThread.BeginInvokeOnMainThread` throws on custom platform backends - Common UI-thread marshaling pattern crashes; `Dispatcher` works but isn't the documented/recommended path](#34101) </details> - Tests: Add 11 missing UnitConverters unit tests by @PureWeen in #35191 </details> <details> <summary>📝 Issue References</summary> Fixes #7580, Fixes #9095, Fixes #11402, Fixes #12916, Fixes #13243, Fixes #13801, Fixes #15806, Fixes #19560, Fixes #19690, Fixes #19866, Fixes #20028, Fixes #26103, Fixes #26366, Fixes #27554, Fixes #29529, Fixes #29772, Fixes #30192, Fixes #30199, Fixes #30254, Fixes #31658, Fixes #31799, Fixes #32971, Fixes #33065, Fixes #33241, Fixes #33334, Fixes #33373, Fixes #33500, Fixes #33615, Fixes #33767, Fixes #33783, Fixes #34101, Fixes #34257, Fixes #34266, Fixes #34402, Fixes #34504, Fixes #34551, Fixes #34611, Fixes #34662, Fixes #34671, Fixes #34716, Fixes #34755, Fixes #34759, Fixes #34771, Fixes #34772, Fixes #34842, Fixes #34846, Fixes #34848, Fixes #34861, Fixes #34889, Fixes #34892, Fixes #34897, Fixes #34898, Fixes #34900, Fixes #34917, Fixes #34925, Fixes #34953, Fixes #34975, Fixes #35005, Fixes #35018, Fixes #35063, Fixes #35116, Fixes #35119, Fixes #35125, Fixes #35127 </details> **Full Changelog**: main...inflight/candidate
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Details:
Shell.OnBackButtonPressed not invoked when the toolbar back button is tapped on Android and iOS Shell pages
Root Cause
Description of change
ShellToolbarTracker.cs (Android Shell)
Test results
Shell —
OnBackButtonPressed(fixes #9095)OnBackButtonPressedGoToAsyncGoToAsyncGoToAsyncTabbedPage —
OnBackButtonPressedOnBackButtonPressedPushAsyncPushModalAsyncPushAsyncPushModalAsyncPushAsyncPushModalAsyncFlyoutPage —
OnBackButtonPressedOnBackButtonPressedPushAsyncPushModalAsyncPushAsyncPushModalAsyncPushAsyncPushModalAsyncValidated the behaviour in the following platforms
Issue Fixes
Fixes #9095
Screenshots
9095_BeforeFix.mov
9095_AfterFix.mov