-
-
Notifications
You must be signed in to change notification settings - Fork 363
fix(AutoComplete): trigger onBlur when clicking outside #5476
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 fixes an issue where the AutoComplete component was not triggering the onBlur event when clicking outside of the component. The fix involves adding a blur event listener to the input element, removing the menu click handler, and moving the blur logic to the key event handlers. A new property was added to control blur triggering. Sequence diagram for AutoComplete onBlur event triggeringsequenceDiagram
participant User
participant AutoCompleteInput as Input
participant AutoCompleteMenu as Menu
participant Blazor
User->>Input: Clicks outside
activate Input
Input-->>User: blur event
deactivate Input
Input->>Blazor: TriggerBlur()
activate Blazor
Blazor-->>Input: Response
deactivate Blazor
Sequence diagram for AutoComplete Enter key presssequenceDiagram
participant User
participant AutoCompleteInput as Input
participant AutoCompleteMenu as Menu
participant Blazor
User->>Input: Presses Enter
activate Input
Input->>Menu: current.click()
activate Menu
Menu-->>Input: Response
deactivate Menu
Input->>Input: blur()
Input-->>User: blur event
deactivate Input
Input->>Blazor: EnterCallback(input.value)
activate Blazor
Blazor-->>Input: Response
deactivate Blazor
Sequence diagram for AutoComplete Escape key presssequenceDiagram
participant User
participant AutoCompleteInput as Input
participant AutoCompleteMenu as Menu
participant Blazor
User->>Input: Presses Escape
activate Input
Input->>Input: blur()
Input-->>User: blur event
deactivate Input
Input->>Blazor: EscCallback()
activate Blazor
Blazor-->>Input: Response
deactivate Blazor
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.
We encountered an error and are unable to review this PR. We have been notified and are working to fix it.
You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5476 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 646 646
Lines 29373 29374 +1
Branches 4134 4135 +1
=========================================
+ Hits 29373 29374 +1 ☔ View full report in Codecov by Sentry. |
|
@sourcery-ai review |
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:
- The javascript changes look good, but I'm not sure I understand why the menu click handler was removed.
- Consider adding a comment to explain the purpose of the
data-bb-blurattribute.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 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.
Link issues
fixes #5475
Regression?
[If yes, specify the version the behavior has regressed from]
[是否影响老版本]
Risk
[Justify the selection above]
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary of the changes
Summary by Sourcery
Bug Fixes:
Summary by Sourcery
Bug Fixes: