Add missing sample code to BitDropdown demo page (#12256)#12272
Add missing sample code to BitDropdown demo page (#12256)#12272zahra-yousefi wants to merge 1 commit intobitfoundation:developfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdded the missing Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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
Note
Copilot was unable to run its full agentic suite in this review.
Adds the missing sample code required for the BitDropdown demo to demonstrate dynamically adding new dropdown items at runtime (per #12256).
Changes:
- Introduces a handler method that appends a newly created
BitDropdownItem<string>to the demo’scomboBoxItemslist.
|
|
||
| private void HandleOnDynamicAdd(BitDropdownItem<string> item) | ||
| { | ||
| comboBoxItems.Add(item); |
There was a problem hiding this comment.
To make the demo reliably reflect updates in the UI, consider updating comboBoxItems via a new list instance (instead of mutating the existing list) if the BitDropdown/consumer detects changes by reference (common pattern in component libraries). For example, assign a new list containing the old items plus item. Alternatively, if this callback can run outside normal Blazor event dispatch, explicitly triggering a render (e.g., via InvokeAsync(StateHasChanged)) will ensure the newly added item appears immediately.
| comboBoxItems.Add(item); | |
| comboBoxItems = [.. comboBoxItems, item]; |
closes #12256
Summary by CodeRabbit