fix(Textarea): should trigger keyboard event when set UseShiftEnter to false#5656
fix(Textarea): should trigger keyboard event when set UseShiftEnter to false#5656
Conversation
Co-Authored-By: bob9307 <10083842+bob9307@users.noreply.github.com>
Reviewer's Guide by SourceryThis pull request updates the project version and fixes a bug in the Textarea component's JavaScript file related to handling the Enter key when the UseShiftEnter property is set to false. The condition for preventing the default Enter key behavior has been corrected to ensure it only triggers when both the Shift key is pressed and UseShiftEnter is true. Sequence diagram for Textarea Enter key handlingsequenceDiagram
participant User
participant Textarea
User->>Textarea: Presses Enter key (e.key = 'Enter', shiftKey = true, useShiftEnter = true)
Textarea->>Textarea: Check if (shiftKey && useShiftEnter)
Textarea->>Textarea: Condition is true
Textarea->>User: Default action prevented (e.preventDefault())
User->>Textarea: Presses Enter key (e.key = 'Enter', shiftKey = false, useShiftEnter = true)
Textarea->>Textarea: Check if (shiftKey && useShiftEnter)
Textarea->>Textarea: Condition is false
Textarea->>User: Default action not prevented
User->>Textarea: Presses Enter key (e.key = 'Enter', shiftKey = true, useShiftEnter = false)
Textarea->>Textarea: Check if (shiftKey && useShiftEnter)
Textarea->>Textarea: Condition is false
Textarea->>User: Default action not prevented
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:
- The fix looks good, but it might be more readable to invert the conditional to avoid the double negative.
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 #5656 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 654 654
Lines 29576 29576
Branches 4208 4208
=========================================
Hits 29576 29576 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #5654
Summary By Copilot
This pull request includes updates to the
BootstrapBlazorproject version and a bug fix in theTextareacomponent's JavaScript file.Version update:
src/BootstrapBlazor/BootstrapBlazor.csproj: Updated the project version from9.5.0-beta03to9.5.0-beta04.Bug fix in
Textareacomponent:src/BootstrapBlazor/Components/Textarea/Textarea.razor.js: Fixed the condition to prevent default behavior on Enter key press whenshiftKeyis pressed anduseShiftEnteris true.Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Fixes a bug in the Textarea component where the Enter key's default behavior was not prevented correctly when UseShiftEnter was set to false. Also, updates the project version to 9.5.0-beta04.
Bug Fixes:
Chores: