-
-
Notifications
You must be signed in to change notification settings - Fork 363
fix(Textarea): adding new functionality to handle Shift + Enter #5611
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
…allback - Add `hasNoModifiers` helper to check for Ctrl/Shift/Alt/Meta keys - Update Enter key handling in `handleKeyUp` to ignore modifier combinations - Retain existing Escape key logic
Reviewer's Guide by SourceryThis pull request modifies the Sequence diagram for Enter key press with and without modifierssequenceDiagram
participant User
participant textarea
participant BootstrapInput.razor.js
participant invoke
User->>textarea: Presses Enter key (no modifiers)
textarea-->>BootstrapInput.razor.js: keyup event
BootstrapInput.razor.js->>BootstrapInput.razor.js: hasNoModifiers(e) == true
BootstrapInput.razor.js->>invoke: invokeMethodAsync(enterCallbackMethod, el.value)
invoke-->>textarea: Callback triggered
User->>textarea: Presses Ctrl+Enter
textarea-->>BootstrapInput.razor.js: keyup event
BootstrapInput.razor.js->>BootstrapInput.razor.js: hasNoModifiers(e) == false
BootstrapInput.razor.js-->>textarea: Callback not triggered
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Thanks for your PR, @h2ls. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
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 @h2ls - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a comment to explain why
hasNoModifiersis needed.
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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5611 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 649 649
Lines 29622 29622
Branches 4165 4165
=========================================
Hits 29622 29622 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@dotnet-policy-service agree |
|
@microsoft-github-policy-service agree |
|
@sourcery-ai review |
Link issues
fixes #5610
fixes #5609
Summary By Copilot
This pull request includes several changes to the
BootstrapBlazorcomponents, focusing on improving the code readability by translating comments from Chinese to English and adding new functionality to handleShift + Enterkey presses in the input components.Key changes:
Functionality Enhancements:
src/BootstrapBlazor/Components/Input/BootstrapInput.razor.js: Added logic to handleShift + Enterkey presses, preventing the default action ifShiftis held anddata-bb-shift-enterattribute is set to true.Code Readability Improvements:
src/BootstrapBlazor/Components/Input/BootstrapInputBase.cs: Translated all comments from Chinese to English to improve code readability and maintainability. [1] [2] [3] [4] [5] [6]src/BootstrapBlazor/Components/Textarea/Textarea.razor.cs: Translated comments from Chinese to English for better clarity.Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge