Skip to content

Add missing new ClearButtonIcon parameter to BitTextField (#12219)#12220

Merged
msynk merged 1 commit intobitfoundation:developfrom
msynk:12219-blazorui-textfield-new-missing-icon
Mar 28, 2026
Merged

Add missing new ClearButtonIcon parameter to BitTextField (#12219)#12220
msynk merged 1 commit intobitfoundation:developfrom
msynk:12219-blazorui-textfield-new-missing-icon

Conversation

@msynk
Copy link
Copy Markdown
Member

@msynk msynk commented Mar 28, 2026

closes #12219

Summary by CodeRabbit

  • New Features
    • The TextField component now offers customizable clear button icons. Users can select from built-in Fluent UI icon options or provide custom icon rendering to achieve enhanced visual flexibility. This new feature provides developers with comprehensive control over the clear button's appearance. When both icon options are specified, custom rendering takes automatic precedence.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 514cd731-c65a-4ab1-90fa-a074953cbfc9

📥 Commits

Reviewing files that changed from the base of the PR and between 44492ed and 8fea2c7.

📒 Files selected for processing (3)
  • src/BlazorUI/Bit.BlazorUI/Components/Inputs/TextField/BitTextField.razor
  • src/BlazorUI/Bit.BlazorUI/Components/Inputs/TextField/BitTextField.razor.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/TextField/BitTextFieldDemo.razor.cs

Walkthrough

Added customizable clear button icon support to the BitTextField component by introducing two new parameters: ClearButtonIcon for external icon rendering and ClearButtonIconName for built-in Fluent UI icon names. The icon CSS classes are now computed dynamically instead of hardcoded.

Changes

Cohort / File(s) Summary
BitTextField Component
src/BlazorUI/Bit.BlazorUI/Components/Inputs/TextField/BitTextField.razor, src/BlazorUI/Bit.BlazorUI/Components/Inputs/TextField/BitTextField.razor.cs
Added two new parameters (ClearButtonIcon and ClearButtonIconName) to allow customizable clear button icons. Updated Razor markup to dynamically compute icon CSS classes via BitIconInfo.From() instead of using hardcoded cancel icon classes.
BitTextFieldDemo Parameters
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/TextField/BitTextFieldDemo.razor.cs
Extended demo component metadata with the same two new parameters for icon customization, including documentation describing precedence behavior when both parameters are set.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A carrot-loving coder hops with glee,
Custom icons now for all to see!
Clear buttons dressed in new attire,
BitTextField climbing ever higher! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and specifically summarizes the main change: adding the missing ClearButtonIcon parameter to BitTextField component.
Linked Issues check ✅ Passed The PR successfully implements the missing ClearButtonIcon parameter for BitTextField as required by issue #12219, enabling external icon support for the clear button.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the ClearButtonIcon parameter for BitTextField; no out-of-scope modifications were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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 the missing external-icon API surface for BitTextField’s clear button, aligning it with other components that support BitIconInfo-based icon customization.

Changes:

  • Added ClearButtonIcon (BitIconInfo?) and ClearButtonIconName (string?) parameters to BitTextField.
  • Updated BitTextField rendering to use BitIconInfo.From(...) for the clear button icon (with "Cancel" fallback).
  • Updated the demo parameter list to document the new parameters.

Reviewed changes

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

File Description
src/BlazorUI/Bit.BlazorUI/Components/Inputs/TextField/BitTextField.razor.cs Introduces new clear-button icon parameters and docs.
src/BlazorUI/Bit.BlazorUI/Components/Inputs/TextField/BitTextField.razor Switches clear-button icon rendering to BitIconInfo/*IconName pattern.
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/TextField/BitTextFieldDemo.razor.cs Documents the new parameters in the demo metadata.

@msynk msynk merged commit b23cb12 into bitfoundation:develop Mar 28, 2026
7 checks passed
@msynk msynk deleted the 12219-blazorui-textfield-new-missing-icon branch March 28, 2026 19:10
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.

Missing new Icon implementation from the BitTextField component

2 participants