Add missing new ItemCheckIcon parameter to BitDropdown (#12217)#12218
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughAdded customization support for the checkmark icon in BitDropdown multi-select items through two new parameters ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Adds support for customizing the multi-select item checkmark icon in BitDropdown, aligning it with existing external-icon patterns across the component library.
Changes:
- Added
ItemCheckIcon(BitIconInfo?) andItemCheckIconName(string?) parameters toBitDropdown. - Updated dropdown item rendering to use resolved icon CSS classes for the checkmark icon.
- Documented the new parameters in the demo page metadata.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/Dropdown/BitDropdownDemo.razor.cs |
Adds demo/API docs entries for the new icon parameters. |
src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/_BitDropdownItem.razor |
Switches the multi-select checkmark <i> to use resolved icon classes instead of hardcoded Fluent icon classes. |
src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs |
Introduces new parameters and a helper to resolve checkmark icon CSS classes. |
src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs
Outdated
Show resolved
Hide resolved
src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs`:
- Around line 575-578: The GetItemCheckIconCssClasses method uses
ItemCheckIconName ?? "Accept" which only defaults on null and not on empty
strings; update the logic in GetItemCheckIconCssClasses to treat empty (and
optionally whitespace) ItemCheckIconName as missing by using
string.IsNullOrEmpty or string.IsNullOrWhiteSpace (e.g., default to "Accept"
when ItemCheckIconName is null/empty) before calling
BitIconInfo.From(ItemCheckIcon, ...), referencing the GetItemCheckIconCssClasses
method and the ItemCheckIcon/ItemCheckIconName properties so the checkmark icon
isn't lost when a blank name is provided.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 22f0baac-908a-47e8-bbf2-47d9e225c108
📒 Files selected for processing (3)
src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cssrc/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/_BitDropdownItem.razorsrc/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/Dropdown/BitDropdownDemo.razor.cs
closes #12217
Summary by CodeRabbit