Skip to content

fix: support hintTextColor on iOS search bar#4089

Open
skrtdev wants to merge 1 commit into
software-mansion:mainfrom
skrtdev:ios-searchbar-hint-text-color
Open

fix: support hintTextColor on iOS search bar#4089
skrtdev wants to merge 1 commit into
software-mansion:mainfrom
skrtdev:ios-searchbar-hint-text-color

Conversation

@skrtdev
Copy link
Copy Markdown

@skrtdev skrtdev commented May 23, 2026

Summary

  • apply hintTextColor to the iOS search bar placeholder
  • keep the placeholder string stable when the hint color changes
  • update search bar types/docs so hintTextColor is no longer marked Android-only

Test plan

  • git diff --check

clang-format and full package checks were not run locally because this environment does not have the repo toolchain installed.

Copilot AI review requested due to automatic review settings May 23, 2026 20:15
Copy link
Copy Markdown
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

Adds iOS support for the hintTextColor SearchBar option by applying it to the iOS search bar placeholder and keeping the placeholder string stable across hint color updates. This also updates the public types/spec so hintTextColor is no longer presented as Android-only.

Changes:

  • Apply hintTextColor to the iOS UISearchTextField placeholder via attributedPlaceholder.
  • Persist placeholder text in native (_placeholder) so changing hint color doesn’t unintentionally change placeholder content.
  • Update TypeScript types/codegen spec to treat hintTextColor as non-Android-only.

Reviewed changes

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

File Description
src/types.tsx Removes Android-only annotation from hintTextColor in SearchBarProps docs.
src/fabric/SearchBarNativeComponent.ts Moves hintTextColor into the shared prop set (not under “Android only”).
ios/RNSSearchBar.mm Implements setHintTextColor, stores placeholder, and updates Fabric + legacy prop export.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 59 to +63
// TODO: implement these on iOS
barTintColor?: ColorValue | undefined;
tintColor?: ColorValue | undefined;
textColor?: ColorValue | undefined;
hintTextColor?: ColorValue | undefined;
Comment thread ios/RNSSearchBar.mm
Comment on lines +211 to +216
if (_hintTextColor != nil && _placeholder != nil) {
_controller.searchBar.searchTextField.attributedPlaceholder =
[[NSAttributedString alloc] initWithString:_placeholder attributes:@{NSForegroundColorAttributeName : _hintTextColor}];
} else {
[_controller.searchBar setPlaceholder:_placeholder];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants