-
-
Notifications
You must be signed in to change notification settings - Fork 331
fix(AutoComplete): missing value when click delete item #5814
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 introduces a new delete trigger to the AutoComplete component, allowing the component to handle delete key events. The changes include adding a new attribute to the input element, a new method to handle delete key events, and updating the JavaScript to invoke the new method when the delete key is pressed. The pull request also includes enhancements to the unit tests for the AutoComplete component and removes the unused ClassString property. Sequence diagram for handling delete key event in AutoComplete componentsequenceDiagram
participant User
participant AutoComplete.razor
participant AutoComplete.razor.js
User->>AutoComplete.razor: Types in input field and presses Delete key
AutoComplete.razor->>AutoComplete.razor.js: Captures Delete key event
AutoComplete.razor.js->>AutoComplete.razor.js: Checks data-bb-trigger-delete attribute
alt data-bb-trigger-delete is true
AutoComplete.razor.js->>AutoComplete.razor: Invokes TriggerDeleteCallback(input.value)
AutoComplete.razor->>AutoComplete.razor: Updates CurrentValue
end
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 debouncing the
TriggerDeleteCallback
method to avoid excessive calls. - The
_render
flag seems unnecessary; consider removing it for simplification.
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 #5814 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 660 660
Lines 30123 30125 +2
Branches 4251 4251
=========================================
+ Hits 30123 30125 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #5813
Summary By Copilot
This pull request includes several changes to the
AutoComplete
component in theBootstrapBlazor
library. The changes focus on improving the functionality and testing of theAutoComplete
component by adding a new delete trigger and refactoring some existing code.Improvements to
AutoComplete
component functionality:src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor
: Added a new attributedata-bb-trigger-delete="true"
to the input element to handle delete key events.src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor.cs
: Added a new methodTriggerDeleteCallback
to handle delete key events and update theCurrentValue
. Removed the unusedClassString
property. [1] [2]src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor.js
: Updated the JavaScript to invoke the newTriggerDeleteCallback
method when the delete key is pressed.Enhancements to unit tests:
test/UnitTest/Components/AutoCompleteTest.cs
: Updated theItems_Ok
test to check for the newdata-bb-trigger-delete
attribute and added a test case for theTriggerDeleteCallback
method. [1] [2]Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Improve AutoComplete component functionality by adding delete key handling and refactoring related code
Bug Fixes:
Enhancements:
Tests: