-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS/Mac Catalyst 26] Fix Shell.ForegroundColor not applied to ToolbarItems #34085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kubaflo
merged 5 commits into
dotnet:inflight/current
from
SyedAbdulAzeemSF4852:fix-ios26-toolbaritem-color
Mar 3, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
968a471
[iOS 26] Fix Shell foreground color not applied to ToolbarItems
SyedAbdulAzeemSF4852 f715cb1
Modified the fix
SyedAbdulAzeemSF4852 1c02118
Removed the unnecessary comment line
SyedAbdulAzeemSF4852 6c05a8f
Updated the issue tracker ID, file name, and class name to align with…
SyedAbdulAzeemSF4852 83d9524
Update: handle TintColor reset and add baseline snapshost for Mac
SyedAbdulAzeemSF4852 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 34083, "Toolbar Items Do Not Reflect Shell ForegroundColor", PlatformAffected.iOS)] | ||
| public class Issue34083 : Shell | ||
| { | ||
| public Issue34083() | ||
| { | ||
| Items.Add(new Issue34083Page()); | ||
| Shell.SetForegroundColor(this, Colors.Purple); | ||
| } | ||
|
|
||
| public class Issue34083Page : ContentPage | ||
| { | ||
| public Issue34083Page() | ||
| { | ||
| Title = "Home"; | ||
| ToolbarItems.Add(new ToolbarItem | ||
| { | ||
| IconImageSource = "calculator.png", | ||
| Order = ToolbarItemOrder.Primary | ||
| }); | ||
|
|
||
| Content = new Label | ||
| { | ||
| Text = "The test passes if the color is being applied to the toolbar.", | ||
| AutomationId = "Issue34083_DescriptionLabel", | ||
| HorizontalOptions = LayoutOptions.Center, | ||
| VerticalOptions = LayoutOptions.Center | ||
| }; | ||
| } | ||
| } | ||
| } |
Binary file added
BIN
+14 KB
...s.Mac.Tests/snapshots/mac/VerifyShellForegroundColorIsAppliedToToolbarItems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34083.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS // Android Issue Link: https://github.com/dotnet/maui/issues/24676, Windows Issue Link: https://github.com/dotnet/maui/issues/34071 | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue34083 : _IssuesUITest | ||
| { | ||
| public Issue34083(TestDevice testDevice) : base(testDevice) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "Toolbar Items Do Not Reflect Shell ForegroundColor"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Shell)] | ||
| public void VerifyShellForegroundColorIsAppliedToToolbarItems() | ||
| { | ||
| App.WaitForElement("Issue34083_DescriptionLabel"); | ||
| VerifyScreenshot(); | ||
| } | ||
| } | ||
| #endif | ||
Binary file added
BIN
+70.1 KB
...OS.Tests/snapshots/ios-26/VerifyShellForegroundColorIsAppliedToToolbarItems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+30.8 KB
...s.iOS.Tests/snapshots/ios/VerifyShellForegroundColorIsAppliedToToolbarItems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test includes a preprocessor directive
TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWSwhich disables the test on Android and Windows. The comment references two separate issues for Android and Windows failures.However, this test should NOT fail on these platforms - it's testing iOS-specific behavior (the test page is marked
PlatformAffected.iOS). The test should simply not run on Android/Windows.Consider using a cleaner approach:
TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWSdirective entirelyPlatformAffected.iOSattribute in the Issue attribute#if IOS || MACCATALYSTinstead