-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(search-bar): add clear button color support #10903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(search-bar): add clear button color support #10903
Conversation
|
Fixed issue #5193 — added support for clear button color in SearchBar (Android). |
There was a problem hiding this 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 adds support for customizing the clear button color in the SearchBar component across iOS and Android platforms. The change introduces a new clearButtonColor property that allows developers to style the clear/close button.
- Added
clearButtonColorPropertyto the SearchBar common properties - Implemented platform-specific handlers for iOS using
tintColoron the clear button - Implemented platform-specific handlers for Android using
setColorFilteron the close button
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/core/ui/search-bar/search-bar-common.ts | Defines the new clearButtonColorProperty with Color type and equality comparer |
| packages/core/ui/search-bar/index.ios.ts | Implements iOS-specific handler using valueForKey('clearButton') and tintColor |
| packages/core/ui/search-bar/index.android.ts | Implements Android-specific handler using resource ID lookup and setColorFilter |
Comments suppressed due to low confidence (1)
packages/core/ui/search-bar/search-bar-common.ts:14
- The
clearButtonColorproperty declaration is missing from theSearchBarBaseclass. Addpublic clearButtonColor: Color;after line 14 to maintain consistency with other properties liketextFieldBackgroundColorandtextFieldHintColor.
export abstract class SearchBarBase extends View implements SearchBarDefinition {
public static submitEvent = 'submit';
public static clearEvent = 'clear';
public text: string;
public hint: string;
public textFieldBackgroundColor: Color;
public textFieldHintColor: Color;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
View your CI Pipeline Execution ↗ for commit 8bb0dc2
☁️ Nx Cloud last updated this comment at |
PR Checklist
What is the current behavior?
Currently, the SearchBar component on Android does not allow developers to customize the clear button color.
This results in inconsistency with iOS, where developers can already modify the color to match app themes.
What is the new behavior?
This PR introduces support for customizing the clear button color in the SearchBar component on Android.
Developers can now apply any desired color for consistent design and theming across platforms.
Fixes #5193
Example Usage: