fix(AutoComplete): missing value when click delete item#5817
Conversation
Reviewer's Guide by SourceryThis pull request updates the project version and modifies the AutoComplete component to improve its functionality and event handling. The javascript code for the AutoComplete component was modified to include a keyup event handler. No diagrams generated as the changes look simple and do not need a visual representation. 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.
Hey @ArgoZhang - I've reviewed your changes - here's some feedback:
Overall Comments:
- It looks like the handlerKeydown function was split into handlerKeyup and handlerKeydown, but ac is still being passed into handlerKeyup when it's not used.
- Consider adding a comment explaining why the keyup event listener was added.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 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.
| } | ||
| } | ||
|
|
||
| const handlerKeydown = e => { |
There was a problem hiding this comment.
issue (bug_risk): Undefined reference to ac in handlerKeydown.
The keydown event handler now calls handlerKeydown(e), but this function uses 'ac' (e.g. in ac.triggerBlur()) without receiving it as a parameter. This is likely to result in an undefined reference. Consider passing 'ac' to handlerKeydown similarly to how it's done for the keyup handler or capturing it via a closure.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5817 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 660 660
Lines 30125 30125
Branches 4251 4251
=========================================
Hits 30125 30125 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #5814
Summary By Copilot
This pull request includes updates to the
BootstrapBlazorproject version and several changes to theAutoCompletecomponent to improve its functionality and event handling.Version update:
src/BootstrapBlazor/BootstrapBlazor.csproj: Updated the project version from9.5.6-beta02to9.5.6-beta03.Improvements to
AutoCompletecomponent:src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor.js: Modified thehandlerKeydownfunction to remove theacparameter and added a newhandlerKeyupfunction to handle thekeyupevent. [1] [2] [3]src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor.js: Added event listener forkeyupevent and ensured it is properly disposed of when the component is disposed.Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Improve AutoComplete component event handling by separating keydown and keyup event logic
Bug Fixes:
Enhancements: