Skip to content

[iOS/MacCatalyst] Fix Entry clear button appearing dimmed compared to TextColor - #36472

Merged
kubaflo merged 5 commits into
dotnet:inflight/currentfrom
SyedAbdulAzeemSF4852:fix-35517-entry-clearbutton-dimmed
Jul 26, 2026
Merged

kubaflo merged 5 commits into
dotnet:inflight/currentfrom
SyedAbdulAzeemSF4852:fix-35517-entry-clearbutton-dimmed

Conversation

@SyedAbdulAzeemSF4852

Copy link
Copy Markdown
Contributor

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

  • When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor.

Root Cause

  • The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity.

Description of Change

  • In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity.

Issues Fixed

Fixes #35517

Validated the behaviour in the following platforms

  • Windows
  • Android
  • iOS
  • Mac

Output

Platform Before After
iOS
Mac

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36472

Or

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

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Jul 9, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @@SyedAbdulAzeemSF4852! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jul 9, 2026
@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jul 10, 2026
@MauiBot MauiBot added s/agent-gate-failed AI could not verify tests catch the bug s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Jul 10, 2026
MauiBot

This comment was marked as outdated.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 10, 2026

@kubaflo kubaflo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please check the ai's suggestions?

kubaflo pushed a commit that referenced this pull request Jul 11, 2026
Surveyed all 42 maui-copilot (def 27723) builds on improved-reviewer and
found two classes of false-FAILED gate verdicts that should be INCONCLUSIVE:

1. New-snapshot VisualTest PRs (e.g. PR #36448, build 14627406): a run that
   reports SOME real passes AND failures where every failure is a brand-new
   VerifyScreenshot with no committed baseline ("Baseline snapshot not yet
   created") took the trust-the-counts path in Get-TestResultFromOutput and
   returned a plain N-test FAIL, never reaching the baseline-missing check
   lower in the function (Passed=2, Failed=30 -> FAILED). Now, inside that
   path, if baseline-missing occurrences >= failCount the run is classified
   SnapshotBaselineMissing (INCONCLUSIVE). A real pixel diff against an
   EXISTING baseline prints 'Snapshot different than baseline' (not 'not yet
   created'), so mixed/real-diff runs still correctly FAIL.

2. Device-test APP_CRASH (PR #36472, build 14627403): both without-fix and
   with-fix crashed identically with 'XHarness exit code: 80 (APP_CRASH)'
   and Failed=0 (app died during instrumentation, no test result) yet the
   pair was scored a genuine FAILED. Added exit-80 to the env-error patterns
   so an app crash is treated as infra/INCONCLUSIVE, consistent with the
   existing exit-83/78 and 'Application test run crashed' handling.

Both convert false-FAILED -> non-blocking INCONCLUSIVE. Unit-tested 6
scenarios (new-snapshots, real-diff guard, mixed guard, clean pass, exit-80,
exit-83 regression) — all pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 3 findings

See inline comments for details.

@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-fix-win AI found a better alternative fix than the PR labels Jul 11, 2026
MauiBot

This comment was marked as outdated.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jul 12, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 2 findings

See inline comments for details.

MauiBot

This comment was marked as outdated.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 12, 2026

@kubaflo kubaflo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it ready? It has [wip] in the title, so I'd rather ask :)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes iOS/MacCatalyst Entry clear button (✕) tinting so it no longer appears dimmed when TextColor is set, aligning the rendered glyph opacity with the entry text.

Changes:

  • Adjusts clear-button tint image generation to draw a bitmap-backed UIImage before applying the SourceIn tint fill, avoiding unintended alpha reduction.
  • Adds an iOS/MacCatalyst device test that asserts the tinted clear-button image contains fully opaque pixels (max alpha = 255).

Reviewed changes

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

File Description
src/Core/src/Platform/iOS/TextFieldExtensions.cs Updates clear-button tint rendering to avoid reduced-alpha rasterization and preserve the expected visual intensity.
src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs Adds a regression test validating clear-button tint opacity when TextColor is applied.

Comment on lines +284 to +288
var bitmapImage = image.CGImage is CGImage cgImage
? new UIImage(cgImage, image.CurrentScale, image.Orientation)
: image;
// bitmapImage's Size can be smaller than the original image's Size, so drawing it at
// CGPoint.Empty shifts it to the top-left instead of centering it. Center it manually
Comment on lines +924 to +941
const int bitsPerComponent = 8;
const int bytesPerPixel = 4; // R, G, B, A (CGImageAlphaInfo.PremultipliedLast)
const int alphaByteOffset = 3; // A is the 4th byte within each RGBA pixel

var cgImage = image.CGImage;
Assert.NotNull(cgImage);

var width = (int)cgImage.Width;
var height = (int)cgImage.Height;
var bytesPerRow = width * bytesPerPixel;
var pixels = new byte[height * bytesPerRow];

using var colorSpace = CGColorSpace.CreateDeviceRGB();
using (var context = new CGBitmapContext(pixels, width, height, bitsPerComponent, bytesPerRow, colorSpace, CGImageAlphaInfo.PremultipliedLast))
{
context.DrawImage(new CGRect(0, 0, width, height), cgImage);
}

@kubaflo
kubaflo force-pushed the inflight/current branch from a4223bb to c4e03cc Compare July 22, 2026 21:04
@SyedAbdulAzeemSF4852 SyedAbdulAzeemSF4852 changed the title [WIP][iOS/MacCatalyst] Fix Entry clear button appearing dimmed compared to TextColor [iOS/MacCatalyst] Fix Entry clear button appearing dimmed compared to TextColor Jul 23, 2026
@kubaflo
kubaflo merged commit 9beab5f into dotnet:inflight/current Jul 26, 2026
4 of 36 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR10 milestone Jul 26, 2026
kubaflo pushed a commit that referenced this pull request Jul 28, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Jul 29, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Aug 7, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Aug 12, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
@sheiksyedm sheiksyedm modified the milestones: .NET 10 SR10, .NET 10 SR11 Aug 26, 2026
kubaflo pushed a commit that referenced this pull request Aug 27, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Sep 2, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Sep 3, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Sep 3, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Sep 4, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Sep 6, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Sep 7, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Sep 7, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Sep 8, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Sep 8, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Sep 9, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
kubaflo pushed a commit that referenced this pull request Sep 9, 2026
… TextColor (#36472)

<!-- 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 an Entry control has a TextColor set and ClearButtonVisibility is
enabled, the clear button (✕) appears faded/dimmed compared to the
TextColor.

### Root Cause

- The clear button's image was being drawn directly into the tinting
context at reduced opacity, and because CGBlendMode.SourceIn compositing
caps the final color's alpha at the alpha of the shape it's masking
against, that reduced opacity carried through to the final tinted color
— making the clear button appear dim instead of matching TextColor at
full opacity.

### Description of Change
- In GetClearButtonTintImage (TextFieldExtensions.cs), the code now
builds a plain UIImage from the clear button image's underlying CGImage
(preserving CurrentScale and Orientation) and draws that bitmap-backed
copy instead of drawing the original image directly, before the existing
SourceIn color-fill step — the clear button image now renders with full
opacity.

### Issues Fixed
Fixes #35517

### Validated the behaviour in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119">
| <img
src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff">
|
| Mac | <img
src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32">
| <img
src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907">
|
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MacCatalyst] [Entry] ClearButtonVisibility color appears dimmed compared to TextColor

6 participants