Skip to content

[iOS] SearchBar placeholder color is not updating on theme change - fix - #30597

Merged
jfversluis merged 5 commits into
dotnet:inflight/currentfrom
kubaflo:fix-30596
Aug 25, 2025
Merged

jfversluis merged 5 commits into
dotnet:inflight/currentfrom
kubaflo:fix-30596

Conversation

@kubaflo

@kubaflo kubaflo commented Jul 13, 2025

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!

Description of Change

Before After
Screen.Recording.2025-07-13.at.17.06.53.mov
Screen.Recording.2025-07-13.at.17.04.48.mov

Issues Fixed

Fixes #30596

Copilot AI review requested due to automatic review settings July 13, 2025 15:14
@kubaflo
kubaflo requested a review from a team as a code owner July 13, 2025 15:14
@kubaflo kubaflo self-assigned this Jul 13, 2025
@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Jul 13, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

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

This PR fixes the iOS SearchBar so that its placeholder color properly updates when the app’s theme changes by refactoring how the attributed placeholder is generated.

  • Replace the old null-coalescing and multiple NSAttributedString calls with pattern matching on PlaceholderColor
  • Use the platform’s default placeholder color (ColorExtensions.PlaceholderColor) as a direct UIColor fallback
  • Streamline the attributed placeholder assignment while preserving character spacing

Comment thread src/Core/src/Platform/iOS/SearchBarExtensions.cs Outdated
@kubaflo
kubaflo force-pushed the fix-30596 branch 2 times, most recently from 9fa97f2 to b14765b Compare July 13, 2025 15:27
@jsuarezruiz

Copy link
Copy Markdown
Contributor

/azp run MAUI-UITests-public

@azure-pipelines

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

{
App.WaitForElement("changeThemeButton");
App.Tap("changeThemeButton");
VerifyScreenshot();

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.

Pending snapshot, running a build.

Comment thread src/Core/src/Platform/iOS/SearchBarExtensions.cs Outdated
Comment thread src/Core/src/Platform/iOS/SearchBarExtensions.cs Outdated
@jsuarezruiz

jsuarezruiz commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

/azp run MAUI-UITests-public

@azure-pipelines

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

@jfversluis

Copy link
Copy Markdown
Member

/rebase

@azure-pipelines

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

@jfversluis
jfversluis changed the base branch from main to inflight/current August 25, 2025 12:13
@jfversluis jfversluis added this to the .NET 9 SR12 milestone Aug 25, 2025
@jfversluis
jfversluis merged commit ab5ee64 into dotnet:inflight/current Aug 25, 2025
76 of 78 checks passed
PureWeen pushed a commit that referenced this pull request Sep 5, 2025
Added a UI Test

Update Issue30597.cs

Update SearchBarExtensions.cs

Added snapshots
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-searchbar SearchBar control community ✨ Community Contribution platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] SearchBar placeholder color is not updating on theme change

4 participants