-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
fix: fix the issue of Textarea not being able to wrap lines in the form #4691
Conversation
…wrap lines in the form
|
WalkthroughThe changes in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
修复由 #4670 带来的 Textarea 无法回车换行的问题 |
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/@core/ui-kit/form-ui/src/vben-use-form.vue (1)
42-49
: Approve changes with a minor suggestionThe changes to
handleKeyDownEnter
function effectively address the issue with Textarea line wrapping. The new implementation provides more precise control over the Enter key behavior by checking the event target.Consider adding a type annotation for the
event.target
check to improve code readability:- if (event.target instanceof HTMLTextAreaElement) { + if ((event.target as HTMLElement).tagName === 'TEXTAREA') {This change makes the intention clearer and aligns with TypeScript best practices.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- packages/@core/ui-kit/form-ui/src/vben-use-form.vue (2 hunks)
🧰 Additional context used
🔇 Additional comments (2)
packages/@core/ui-kit/form-ui/src/vben-use-form.vue (2)
59-59
: Approve template changesThe update to the
@keydown.enter
event handler in the template is consistent with the changes made to thehandleKeyDownEnter
function. Removing the.prevent
modifier and directly calling the function allows for more flexible handling of the Enter key event.
Line range hint
42-59
: Summary of changes and their impactThe changes in this file effectively address the issue of Textarea not being able to wrap lines properly. The
handleKeyDownEnter
function has been updated to conditionally handle the Enter key event based on the target element, allowing textareas to behave as expected while maintaining the desired behavior for other form elements.These changes align well with the PR objectives and provide a clean solution to the reported bug. The implementation is straightforward and doesn't introduce any apparent new issues or complexities.
…wrap lines in the form (vbenjs#4691)
fix the issue of Textarea not being able to wrap lines in the form.
Description
Type of change
Please delete options that are not relevant.
pnpm-lock.yaml
unless you introduce a new test example.Checklist
pnpm run docs:dev
command.pnpm test
.feat:
,fix:
,perf:
,docs:
, orchore:
.Summary by CodeRabbit
New Features
textarea
.Bug Fixes