-
-
Notifications
You must be signed in to change notification settings - Fork 363
refactor(AutoComplete): revert blur event callback #5836
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
Conversation
Reviewer's Guide by SourceryThis pull request refactors the Sequence diagram for AutoComplete blur eventsequenceDiagram
participant User
participant AutoComplete
User->>AutoComplete: Triggers blur event on input element
activate AutoComplete
AutoComplete->>AutoComplete: Calls OnBlur callback
deactivate AutoComplete
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @ArgoZhang - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a small delay before calling
_dropdown.Render()inSearch.razor.csto avoid potential race conditions. - It looks like the
TriggerFiltermethods are no longer overriding base class methods - can the[JSInvokable]attribute be moved to the interface?
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5836 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 660 660
Lines 30116 30105 -11
Branches 4252 4251 -1
=========================================
- Hits 30116 30105 -11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* refactor: 移除 TriggerFilter 方法 * refactor: 精简代码 * refactor: 增加 OnBlur 支持 * test: 更新单元测试
Link issues
fixes #5835
Summary By Copilot
This pull request introduces several updates to the
AutoComplete,AutoFill, andSearchcomponents in theBootstrapBlazorlibrary, focusing on improving event handling and cleaning up unused or redundant code. The most significant changes involve replacing or removing overridden methods, refining event handling logic, and updating unit tests to reflect these changes.Event Handling Improvements:
src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor: Added an@onblurevent to bind theOnBlurcallback directly to the input element for better handling of blur events.src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor.cs: Removed theoverridekeyword from theTriggerFiltermethod, making it a standalone method. This aligns with the updated event-handling strategy.src/BootstrapBlazor/Components/AutoFill/AutoFill.razor.cs: Similarly, removed theoverridekeyword from theTriggerFiltermethod to simplify the event-handling logic.Code Cleanup:
src/BootstrapBlazor/Components/AutoComplete/PopoverCompleteBase.cs: Removed unused methods, includingTriggerBlurand the overriddenTriggerFilter, as they are no longer required with the updated approach.src/BootstrapBlazor/Components/Search/Search.razor.cs: Removed the_renderfield and theShouldRendermethod, as they were redundant and no longer necessary for the component's functionality.Unit Test Updates:
test/UnitTest/Components/AutoCompleteTest.cs: Updated theOnBlurAsync_Oktest to simulate theBlurevent directly on the input element instead of invoking the removedTriggerBlurmethod.test/UnitTest/Components/AutoCompleteTest.cs: Adjusted theTrigger_Oktest to use the updatedTriggerFiltermethod, which no longer overrides a base method.Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Refactor event handling and clean up code in AutoComplete, AutoFill, and Search components by simplifying method signatures and removing redundant code
Bug Fixes:
Enhancements:
Tests:
Chores: